From e1bd4ac5bb23725d3e1adead032403c5c6a94f12 Mon Sep 17 00:00:00 2001 From: cs1111 Date: Tue, 9 Apr 2024 17:30:14 +0800 Subject: [PATCH] update 1.6.2 openeuler Signed-off-by: cs1111 --- BUILD.gn | 632 +++++++------ CMakeLists.txt | 103 --- NOTICE | 1 - README.OpenSource | 2 +- autogen.sh | 9 - debug.log | 0 include/config.h.cmake.in | 10 - include/libunwind-common.h | 318 ------- include/libunwind_i-ohos.h | 64 -- include/map_info.h | 50 - include/mingw/elf.h | 15 - include/mingw/endian.h | 15 - include/mingw/freebsd-elf32.h | 245 ----- include/mingw/freebsd-elf64.h | 252 ----- include/mingw/freebsd-elf_common.h | 865 ------------------ include/mingw/signal.h | 38 - include/mingw/sys/mman.h | 27 - include/mingw/sys/syscall.h | 10 - include/mingw/sys/ucontext.h | 40 - include/mingw/ucontext.h | 11 - include/mingw/unistd.h | 34 - include/ohos-config.h | 23 - include/win/elf.h | 16 - include/win/endian.h | 16 - include/win/fakestdalign.h.in | 9 - include/win/fakestdatomic.h.in | 36 - include/win/freebsd-elf32.h | 245 ----- include/win/freebsd-elf64.h | 252 ----- include/win/freebsd-elf_common.h | 865 ------------------ include/win/pthread.h | 30 - include/win/signal.h | 40 - include/win/sys/mman.h | 23 - include/win/sys/syscall.h | 11 - include/win/sys/types.h | 19 - include/win/sys/ucontext.h | 42 - include/win/ucontext.h | 13 - include/win/unistd.h | 28 - include/x86/jmpbuf.h | 31 - libunwind.gni | 130 +-- libunwind.spec | 158 ++++ libunwind.yaml | 4 + AUTHORS => libunwind/AUTHORS | 0 COPYING => libunwind/COPYING | 0 ChangeLog => libunwind/ChangeLog | 0 Makefile.am => libunwind/Makefile.am | 0 NEWS => libunwind/NEWS | 0 libunwind/README | 241 +++++ TODO => libunwind/TODO | 0 acinclude.m4 => libunwind/acinclude.m4 | 0 configure.ac => libunwind/configure.ac | 8 +- {doc => libunwind/doc}/Makefile.am | 0 {doc => libunwind/doc}/NOTES | 0 {doc => libunwind/doc}/_U_dyn_cancel.man | 0 {doc => libunwind/doc}/_U_dyn_cancel.tex | 0 {doc => libunwind/doc}/_U_dyn_register.man | 0 {doc => libunwind/doc}/_U_dyn_register.tex | 0 {doc => libunwind/doc}/common.tex.in | 0 {doc => libunwind/doc}/libunwind-dynamic.man | 0 {doc => libunwind/doc}/libunwind-dynamic.tex | 0 {doc => libunwind/doc}/libunwind-ia64.man | 0 {doc => libunwind/doc}/libunwind-ia64.tex | 0 {doc => libunwind/doc}/libunwind-ptrace.man | 0 {doc => libunwind/doc}/libunwind-ptrace.tex | 0 {doc => libunwind/doc}/libunwind-setjmp.man | 0 {doc => libunwind/doc}/libunwind-setjmp.tex | 0 {doc => libunwind/doc}/libunwind.man | 0 {doc => libunwind/doc}/libunwind.tex | 0 {doc => libunwind/doc}/libunwind.trans | 0 .../doc}/unw_apply_reg_state.man | 0 .../doc}/unw_apply_reg_state.tex | 0 {doc => libunwind/doc}/unw_backtrace.man | 0 {doc => libunwind/doc}/unw_backtrace.tex | 0 .../doc}/unw_create_addr_space.man | 0 .../doc}/unw_create_addr_space.tex | 0 .../doc}/unw_destroy_addr_space.man | 0 .../doc}/unw_destroy_addr_space.tex | 0 {doc => libunwind/doc}/unw_flush_cache.man | 0 {doc => libunwind/doc}/unw_flush_cache.tex | 0 {doc => libunwind/doc}/unw_get_accessors.man | 0 {doc => libunwind/doc}/unw_get_accessors.tex | 0 {doc => libunwind/doc}/unw_get_fpreg.man | 0 {doc => libunwind/doc}/unw_get_fpreg.tex | 0 {doc => libunwind/doc}/unw_get_proc_info.man | 0 {doc => libunwind/doc}/unw_get_proc_info.tex | 0 .../doc}/unw_get_proc_info_by_ip.man | 0 .../doc}/unw_get_proc_info_by_ip.tex | 0 {doc => libunwind/doc}/unw_get_proc_name.man | 6 +- {doc => libunwind/doc}/unw_get_proc_name.tex | 0 {doc => libunwind/doc}/unw_get_reg.man | 0 {doc => libunwind/doc}/unw_get_reg.tex | 0 {doc => libunwind/doc}/unw_getcontext.man | 0 {doc => libunwind/doc}/unw_getcontext.tex | 0 {doc => libunwind/doc}/unw_init_local.man | 0 {doc => libunwind/doc}/unw_init_local.tex | 0 {doc => libunwind/doc}/unw_init_local2.man | 0 {doc => libunwind/doc}/unw_init_remote.man | 0 {doc => libunwind/doc}/unw_init_remote.tex | 0 {doc => libunwind/doc}/unw_is_fpreg.man | 0 {doc => libunwind/doc}/unw_is_fpreg.tex | 0 .../doc}/unw_is_signal_frame.man | 0 .../doc}/unw_is_signal_frame.tex | 0 .../doc}/unw_reg_states_iterate.man | 0 .../doc}/unw_reg_states_iterate.tex | 0 {doc => libunwind/doc}/unw_regname.man | 0 {doc => libunwind/doc}/unw_regname.tex | 0 {doc => libunwind/doc}/unw_resume.man | 0 {doc => libunwind/doc}/unw_resume.tex | 0 {doc => libunwind/doc}/unw_set_cache_size.man | 0 {doc => libunwind/doc}/unw_set_cache_size.tex | 0 .../doc}/unw_set_caching_policy.man | 0 .../doc}/unw_set_caching_policy.tex | 0 {doc => libunwind/doc}/unw_set_fpreg.man | 0 {doc => libunwind/doc}/unw_set_fpreg.tex | 0 {doc => libunwind/doc}/unw_set_reg.man | 0 {doc => libunwind/doc}/unw_set_reg.tex | 0 {doc => libunwind/doc}/unw_step.man | 0 {doc => libunwind/doc}/unw_step.tex | 0 {doc => libunwind/doc}/unw_strerror.man | 0 {doc => libunwind/doc}/unw_strerror.tex | 0 {include => libunwind/include}/compiler.h | 0 {include => libunwind/include}/config.h | 74 +- libunwind/include/config.h.in | 246 +++++ {include => libunwind/include}/dwarf-eh.h | 0 {include => libunwind/include}/dwarf.h | 23 +- {include => libunwind/include}/dwarf_i.h | 2 +- .../include}/libunwind-aarch64.h | 19 +- .../include}/libunwind-arm.h | 34 +- libunwind/include/libunwind-common.h | 292 ++++++ .../include}/libunwind-common.h.in | 20 +- .../include}/libunwind-coredump.h | 0 .../include}/libunwind-dynamic.h | 2 +- .../include}/libunwind-hppa.h | 0 .../include}/libunwind-ia64.h | 0 .../include}/libunwind-mips.h | 0 .../include}/libunwind-ppc32.h | 0 .../include}/libunwind-ppc64.h | 0 .../include}/libunwind-ptrace.h | 0 .../include}/libunwind-riscv.h | 0 .../include}/libunwind-s390x.h | 0 {include => libunwind/include}/libunwind-sh.h | 0 .../include}/libunwind-tilegx.h | 0 .../include}/libunwind-x86.h | 6 - .../include}/libunwind-x86_64.h | 0 {include => libunwind/include}/libunwind.h | 14 +- {include => libunwind/include}/libunwind.h.in | 0 {include => libunwind/include}/libunwind_i.h | 79 +- {include => libunwind/include}/mempool.h | 4 +- {include => libunwind/include}/remote.h | 10 +- libunwind/include/stamp-h1 | 1 + .../include}/tdep-aarch64/dwarf-config.h | 4 +- .../include}/tdep-aarch64/jmpbuf.h | 0 .../include}/tdep-aarch64/libunwind_i.h | 55 +- .../include}/tdep-arm/dwarf-config.h | 0 .../include}/tdep-arm/ex_tables.h | 0 .../include}/tdep-arm/jmpbuf.h | 0 .../include}/tdep-arm/libunwind_i.h | 61 +- .../include}/tdep-hppa/dwarf-config.h | 0 .../include}/tdep-hppa/jmpbuf.h | 0 .../include}/tdep-hppa/libunwind_i.h | 13 +- .../include}/tdep-ia64/jmpbuf.h | 0 .../include}/tdep-ia64/libunwind_i.h | 14 +- .../include}/tdep-ia64/rse.h | 0 .../include}/tdep-ia64/script.h | 0 .../include}/tdep-mips/dwarf-config.h | 0 .../include}/tdep-mips/jmpbuf.h | 0 .../include}/tdep-mips/libunwind_i.h | 29 +- .../include}/tdep-ppc32/dwarf-config.h | 0 .../include}/tdep-ppc32/jmpbuf.h | 0 .../include}/tdep-ppc32/libunwind_i.h | 13 +- .../include}/tdep-ppc64/dwarf-config.h | 0 .../include}/tdep-ppc64/jmpbuf.h | 0 .../include}/tdep-ppc64/libunwind_i.h | 13 +- .../include}/tdep-riscv/dwarf-config.h | 0 .../include}/tdep-riscv/jmpbuf.h | 0 .../include}/tdep-riscv/libunwind_i.h | 25 +- .../include}/tdep-s390x/dwarf-config.h | 0 .../include}/tdep-s390x/jmpbuf.h | 0 .../include}/tdep-s390x/libunwind_i.h | 0 .../include}/tdep-sh/dwarf-config.h | 0 .../include}/tdep-sh/jmpbuf.h | 0 .../include}/tdep-sh/libunwind_i.h | 13 +- .../include}/tdep-tilegx/dwarf-config.h | 0 .../include}/tdep-tilegx/jmpbuf.h | 0 .../include}/tdep-tilegx/libunwind_i.h | 0 .../include}/tdep-x86/dwarf-config.h | 0 .../include}/tdep-x86/jmpbuf.h | 0 .../include}/tdep-x86/libunwind_i.h | 27 +- .../include}/tdep-x86_64/dwarf-config.h | 0 .../include}/tdep-x86_64/jmpbuf.h | 0 .../include}/tdep-x86_64/libunwind_i.h | 44 +- .../include}/tdep/dwarf-config.h | 0 {include => libunwind/include}/tdep/jmpbuf.h | 0 .../include}/tdep/libunwind_i.h | 14 +- .../include}/tdep/libunwind_i.h.in | 0 {include => libunwind/include}/unwind.h | 0 {src => libunwind/src}/Makefile.am | 2 +- .../src}/aarch64/Gapply_reg_state.c | 0 .../src}/aarch64/Gcreate_addr_space.c | 3 +- .../src}/aarch64/Gget_proc_info.c | 0 .../src}/aarch64/Gget_save_loc.c | 0 {src => libunwind/src}/aarch64/Gglobal.c | 2 +- {src => libunwind/src}/aarch64/Ginit.c | 59 +- {src => libunwind/src}/aarch64/Ginit_local.c | 27 +- {src => libunwind/src}/aarch64/Ginit_remote.c | 3 - .../src}/aarch64/Gis_signal_frame.c | 0 .../src}/aarch64/Greg_states_iterate.c | 0 {src => libunwind/src}/aarch64/Gregs.c | 3 - {src => libunwind/src}/aarch64/Gresume.c | 0 {src => libunwind/src}/aarch64/Gstash_frame.c | 0 {src => libunwind/src}/aarch64/Gstep.c | 130 +-- {src => libunwind/src}/aarch64/Gtrace.c | 0 .../src}/aarch64/Lapply_reg_state.c | 0 .../src}/aarch64/Lcreate_addr_space.c | 0 .../src}/aarch64/Lget_proc_info.c | 0 .../src}/aarch64/Lget_save_loc.c | 0 {src => libunwind/src}/aarch64/Lglobal.c | 0 {src => libunwind/src}/aarch64/Linit.c | 0 {src => libunwind/src}/aarch64/Linit_local.c | 0 {src => libunwind/src}/aarch64/Linit_remote.c | 0 .../src}/aarch64/Lis_signal_frame.c | 0 .../src}/aarch64/Lreg_states_iterate.c | 0 {src => libunwind/src}/aarch64/Lregs.c | 0 {src => libunwind/src}/aarch64/Lresume.c | 0 {src => libunwind/src}/aarch64/Lstash_frame.c | 0 {src => libunwind/src}/aarch64/Lstep.c | 0 {src => libunwind/src}/aarch64/Ltrace.c | 0 {src => libunwind/src}/aarch64/getcontext.S | 0 {src => libunwind/src}/aarch64/init.h | 2 - {src => libunwind/src}/aarch64/is_fpreg.c | 0 {src => libunwind/src}/aarch64/offsets.h | 0 {src => libunwind/src}/aarch64/regname.c | 0 {src => libunwind/src}/aarch64/siglongjmp.S | 0 {src => libunwind/src}/aarch64/unwind_i.h | 1 - {src => libunwind/src}/arm/Gapply_reg_state.c | 0 .../src}/arm/Gcreate_addr_space.c | 3 +- {src => libunwind/src}/arm/Gex_tables.c | 22 +- {src => libunwind/src}/arm/Gget_proc_info.c | 0 {src => libunwind/src}/arm/Gget_save_loc.c | 0 {src => libunwind/src}/arm/Gglobal.c | 1 - {src => libunwind/src}/arm/Ginit.c | 266 +----- {src => libunwind/src}/arm/Ginit_local.c | 28 +- .../mips => libunwind/src/arm}/Ginit_remote.c | 0 {src => libunwind/src}/arm/Gos-freebsd.c | 5 +- {src => libunwind/src}/arm/Gos-linux.c | 5 +- {src => libunwind/src}/arm/Gos-other.c | 0 .../src}/arm/Greg_states_iterate.c | 0 {src => libunwind/src}/arm/Gregs.c | 0 {src => libunwind/src}/arm/Gresume.c | 0 {src => libunwind/src}/arm/Gstash_frame.c | 0 {src => libunwind/src}/arm/Gstep.c | 44 +- {src => libunwind/src}/arm/Gtrace.c | 1 - {src => libunwind/src}/arm/Lapply_reg_state.c | 0 .../src}/arm/Lcreate_addr_space.c | 0 {src => libunwind/src}/arm/Lex_tables.c | 0 {src => libunwind/src}/arm/Lget_proc_info.c | 0 {src => libunwind/src}/arm/Lget_save_loc.c | 0 {src => libunwind/src}/arm/Lglobal.c | 0 {src => libunwind/src}/arm/Linit.c | 0 {src => libunwind/src}/arm/Linit_local.c | 0 {src => libunwind/src}/arm/Linit_remote.c | 0 {src => libunwind/src}/arm/Los-freebsd.c | 0 {src => libunwind/src}/arm/Los-linux.c | 0 {src => libunwind/src}/arm/Los-other.c | 0 .../src}/arm/Lreg_states_iterate.c | 0 {src => libunwind/src}/arm/Lregs.c | 0 {src => libunwind/src}/arm/Lresume.c | 0 {src => libunwind/src}/arm/Lstash_frame.c | 0 {src => libunwind/src}/arm/Lstep.c | 0 {src => libunwind/src}/arm/Ltrace.c | 0 {src => libunwind/src}/arm/getcontext.S | 0 {src => libunwind/src}/arm/init.h | 2 - {src => libunwind/src}/arm/is_fpreg.c | 0 {src => libunwind/src}/arm/offsets.h | 0 {src => libunwind/src}/arm/regname.c | 0 {src => libunwind/src}/arm/siglongjmp.S | 0 {src => libunwind/src}/arm/unwind_i.h | 1 - .../src}/coredump/_UCD_access_mem.c | 0 .../src}/coredump/_UCD_access_reg_freebsd.c | 0 .../src}/coredump/_UCD_access_reg_linux.c | 0 .../src}/coredump/_UCD_accessors.c | 0 .../src}/coredump/_UCD_corefile_elf.c | 0 {src => libunwind/src}/coredump/_UCD_create.c | 0 .../src}/coredump/_UCD_destroy.c | 0 .../src}/coredump/_UCD_elf_map_image.c | 0 .../src}/coredump/_UCD_find_proc_info.c | 0 .../src}/coredump/_UCD_get_mapinfo_generic.c | 0 .../src}/coredump/_UCD_get_mapinfo_linux.c | 0 .../src}/coredump/_UCD_get_proc_name.c | 0 .../coredump/_UCD_get_threadinfo_prstatus.c | 0 .../src}/coredump/_UCD_internal.h | 0 {src => libunwind/src}/coredump/_UCD_lib.h | 0 .../src}/coredump/_UPT_access_fpreg.c | 0 {src => libunwind/src}/coredump/_UPT_elf.c | 0 .../coredump/_UPT_get_dyn_info_list_addr.c | 0 .../src}/coredump/_UPT_put_unwind_info.c | 0 {src => libunwind/src}/coredump/_UPT_resume.c | 0 .../src}/coredump/libunwind-coredump.pc.in | 0 {src => libunwind/src}/dl-iterate-phdr.c | 0 {src => libunwind/src}/dwarf/Gexpr.c | 7 +- {src => libunwind/src}/dwarf/Gfde.c | 16 +- .../src}/dwarf/Gfind_proc_info-lsb.c | 16 +- .../src}/dwarf/Gfind_unwind_table.c | 177 +--- {src => libunwind/src}/dwarf/Gparser.c | 138 +-- {src => libunwind/src}/dwarf/Gpe.c | 0 {src => libunwind/src}/dwarf/Lexpr.c | 0 {src => libunwind/src}/dwarf/Lfde.c | 0 .../src}/dwarf/Lfind_proc_info-lsb.c | 0 .../src}/dwarf/Lfind_unwind_table.c | 0 {src => libunwind/src}/dwarf/Lparser.c | 0 {src => libunwind/src}/dwarf/Lpe.c | 0 {src => libunwind/src}/dwarf/global.c | 0 {src => libunwind/src}/elf32.c | 0 {src => libunwind/src}/elf32.h | 0 {src => libunwind/src}/elf64.c | 0 {src => libunwind/src}/elf64.h | 0 {src => libunwind/src}/elfxx.c | 157 +--- {src => libunwind/src}/elfxx.h | 17 +- .../src}/hppa/Gapply_reg_state.c | 0 .../src}/hppa/Gcreate_addr_space.c | 0 {src => libunwind/src}/hppa/Gget_proc_info.c | 0 {src => libunwind/src}/hppa/Gget_save_loc.c | 0 {src => libunwind/src}/hppa/Gglobal.c | 0 {src => libunwind/src}/hppa/Ginit.c | 0 {src => libunwind/src}/hppa/Ginit_local.c | 0 {src => libunwind/src}/hppa/Ginit_remote.c | 0 .../src}/hppa/Gis_signal_frame.c | 0 .../src}/hppa/Greg_states_iterate.c | 0 {src => libunwind/src}/hppa/Gregs.c | 0 {src => libunwind/src}/hppa/Gresume.c | 0 {src => libunwind/src}/hppa/Gstep.c | 0 .../src}/hppa/Lapply_reg_state.c | 0 .../src}/hppa/Lcreate_addr_space.c | 0 {src => libunwind/src}/hppa/Lget_proc_info.c | 0 {src => libunwind/src}/hppa/Lget_save_loc.c | 0 {src => libunwind/src}/hppa/Lglobal.c | 0 {src => libunwind/src}/hppa/Linit.c | 0 {src => libunwind/src}/hppa/Linit_local.c | 0 {src => libunwind/src}/hppa/Linit_remote.c | 0 .../src/hppa}/Lis_signal_frame.c | 0 .../src}/hppa/Lreg_states_iterate.c | 0 {src => libunwind/src}/hppa/Lregs.c | 0 {src => libunwind/src}/hppa/Lresume.c | 0 {src => libunwind/src}/hppa/Lstep.c | 0 {src => libunwind/src}/hppa/getcontext.S | 0 {src => libunwind/src}/hppa/init.h | 0 {src => libunwind/src}/hppa/offsets.h | 0 {src => libunwind/src}/hppa/regname.c | 0 {src => libunwind/src}/hppa/setcontext.S | 0 {src => libunwind/src}/hppa/siglongjmp.S | 0 {src => libunwind/src}/hppa/unwind_i.h | 0 .../src}/ia64/Gapply_reg_state.c | 0 .../src}/ia64/Gcreate_addr_space.c | 0 .../src}/ia64/Gfind_unwind_table.c | 0 {src => libunwind/src}/ia64/Gget_proc_info.c | 0 {src => libunwind/src}/ia64/Gget_save_loc.c | 0 {src => libunwind/src}/ia64/Gglobal.c | 0 {src => libunwind/src}/ia64/Ginit.c | 0 {src => libunwind/src}/ia64/Ginit_local.c | 0 {src => libunwind/src}/ia64/Ginit_remote.c | 0 {src => libunwind/src}/ia64/Ginstall_cursor.S | 0 .../src}/ia64/Gis_signal_frame.c | 0 {src => libunwind/src}/ia64/Gparser.c | 0 {src => libunwind/src}/ia64/Grbs.c | 0 .../src}/ia64/Greg_states_iterate.c | 0 {src => libunwind/src}/ia64/Gregs.c | 0 {src => libunwind/src}/ia64/Gresume.c | 0 {src => libunwind/src}/ia64/Gscript.c | 0 {src => libunwind/src}/ia64/Gstep.c | 0 {src => libunwind/src}/ia64/Gtables.c | 0 .../src}/ia64/Lapply_reg_state.c | 0 .../src}/ia64/Lcreate_addr_space.c | 0 .../src}/ia64/Lfind_unwind_table.c | 0 {src => libunwind/src}/ia64/Lget_proc_info.c | 0 {src => libunwind/src}/ia64/Lget_save_loc.c | 0 {src => libunwind/src}/ia64/Lglobal.c | 0 {src => libunwind/src}/ia64/Linit.c | 0 {src => libunwind/src}/ia64/Linit_local.c | 0 {src => libunwind/src}/ia64/Linit_remote.c | 0 {src => libunwind/src}/ia64/Linstall_cursor.S | 0 .../src/ia64}/Lis_signal_frame.c | 0 {src => libunwind/src}/ia64/Lparser.c | 0 {src => libunwind/src}/ia64/Lrbs.c | 0 .../src}/ia64/Lreg_states_iterate.c | 0 {src => libunwind/src}/ia64/Lregs.c | 0 {src => libunwind/src}/ia64/Lresume.c | 0 {src => libunwind/src}/ia64/Lscript.c | 0 {src => libunwind/src}/ia64/Lstep.c | 0 {src => libunwind/src}/ia64/Ltables.c | 0 {src => libunwind/src}/ia64/dyn_info_list.S | 0 {src => libunwind/src}/ia64/getcontext.S | 0 {src => libunwind/src}/ia64/init.h | 0 {src => libunwind/src}/ia64/longjmp.S | 0 {src => libunwind/src}/ia64/mk_Gcursor_i.c | 0 {src => libunwind/src}/ia64/mk_Lcursor_i.c | 0 {src => libunwind/src}/ia64/mk_cursor_i | 0 {src => libunwind/src}/ia64/offsets.h | 0 {src => libunwind/src}/ia64/regname.c | 0 {src => libunwind/src}/ia64/regs.h | 0 {src => libunwind/src}/ia64/setjmp.S | 0 {src => libunwind/src}/ia64/siglongjmp.S | 0 {src => libunwind/src}/ia64/sigsetjmp.S | 0 {src => libunwind/src}/ia64/ucontext_i.h | 0 {src => libunwind/src}/ia64/unwind_decoder.h | 0 {src => libunwind/src}/ia64/unwind_i.h | 0 .../src}/libunwind-generic.pc.in | 0 .../src}/mi/Gdestroy_addr_space.c | 4 - {src => libunwind/src}/mi/Gdyn-extract.c | 0 {src => libunwind/src}/mi/Gdyn-remote.c | 0 .../src}/mi/Gfind_dynamic_proc_info.c | 0 {src => libunwind/src}/mi/Gget_accessors.c | 0 {src => libunwind/src}/mi/Gget_fpreg.c | 0 .../src}/mi/Gget_proc_info_by_ip.c | 0 {src => libunwind/src}/mi/Gget_proc_name.c | 0 {src => libunwind/src}/mi/Gget_reg.c | 0 .../src}/mi/Gput_dynamic_unwind_info.c | 0 {src => libunwind/src}/mi/Gset_cache_size.c | 0 .../src}/mi/Gset_caching_policy.c | 0 {src => libunwind/src}/mi/Gset_fpreg.c | 0 {src => libunwind/src}/mi/Gset_reg.c | 0 .../src}/mi/Ldestroy_addr_space.c | 0 {src => libunwind/src}/mi/Ldyn-extract.c | 0 .../src}/mi/Lfind_dynamic_proc_info.c | 0 {src => libunwind/src}/mi/Lget_accessors.c | 0 {src => libunwind/src}/mi/Lget_fpreg.c | 0 .../src}/mi/Lget_proc_info_by_ip.c | 0 {src => libunwind/src}/mi/Lget_proc_name.c | 0 {src => libunwind/src}/mi/Lget_reg.c | 0 .../src}/mi/Lput_dynamic_unwind_info.c | 0 {src => libunwind/src}/mi/Lset_cache_size.c | 0 .../src}/mi/Lset_caching_policy.c | 0 {src => libunwind/src}/mi/Lset_fpreg.c | 0 {src => libunwind/src}/mi/Lset_reg.c | 0 {src => libunwind/src}/mi/_ReadSLEB.c | 0 {src => libunwind/src}/mi/_ReadULEB.c | 0 {src => libunwind/src}/mi/backtrace.c | 0 {src => libunwind/src}/mi/dyn-cancel.c | 0 {src => libunwind/src}/mi/dyn-info-list.c | 0 {src => libunwind/src}/mi/dyn-register.c | 0 {src => libunwind/src}/mi/flush_cache.c | 0 {src => libunwind/src}/mi/init.c | 12 +- {src => libunwind/src}/mi/mempool.c | 8 +- {src => libunwind/src}/mi/strerror.c | 0 .../src}/mips/Gapply_reg_state.c | 0 .../src}/mips/Gcreate_addr_space.c | 0 {src => libunwind/src}/mips/Gget_proc_info.c | 0 {src => libunwind/src}/mips/Gget_save_loc.c | 0 {src => libunwind/src}/mips/Gglobal.c | 0 {src => libunwind/src}/mips/Ginit.c | 0 {src => libunwind/src}/mips/Ginit_local.c | 0 {src/sh => libunwind/src/mips}/Ginit_remote.c | 0 .../src}/mips/Gis_signal_frame.c | 0 .../src}/mips/Greg_states_iterate.c | 0 {src => libunwind/src}/mips/Gregs.c | 0 {src => libunwind/src}/mips/Gresume.c | 0 {src => libunwind/src}/mips/Gstep.c | 5 +- .../src}/mips/Lapply_reg_state.c | 0 .../src}/mips/Lcreate_addr_space.c | 0 {src => libunwind/src}/mips/Lget_proc_info.c | 0 {src => libunwind/src}/mips/Lget_save_loc.c | 0 {src => libunwind/src}/mips/Lglobal.c | 0 {src => libunwind/src}/mips/Linit.c | 0 {src => libunwind/src}/mips/Linit_local.c | 0 {src => libunwind/src}/mips/Linit_remote.c | 0 .../src/mips}/Lis_signal_frame.c | 0 .../src}/mips/Lreg_states_iterate.c | 0 {src => libunwind/src}/mips/Lregs.c | 0 {src => libunwind/src}/mips/Lresume.c | 0 {src => libunwind/src}/mips/Lstep.c | 0 {src => libunwind/src}/mips/getcontext.S | 0 {src => libunwind/src}/mips/init.h | 0 {src => libunwind/src}/mips/is_fpreg.c | 0 {src => libunwind/src}/mips/offsets.h | 0 {src => libunwind/src}/mips/regname.c | 0 {src => libunwind/src}/mips/siglongjmp.S | 0 {src => libunwind/src}/mips/unwind_i.h | 0 {src => libunwind/src}/os-freebsd.c | 0 {src => libunwind/src}/os-hpux.c | 0 libunwind/src/os-linux.c | 103 +++ {src => libunwind/src}/os-linux.h | 31 +- {src => libunwind/src}/os-qnx.c | 0 {src => libunwind/src}/os-solaris.c | 0 {src => libunwind/src}/ppc/Gget_proc_info.c | 0 {src => libunwind/src}/ppc/Gget_save_loc.c | 0 {src => libunwind/src}/ppc/Ginit_local.c | 0 {src => libunwind/src}/ppc/Ginit_remote.c | 0 {src => libunwind/src}/ppc/Gis_signal_frame.c | 0 {src => libunwind/src}/ppc/Lget_proc_info.c | 0 {src => libunwind/src}/ppc/Lget_save_loc.c | 0 {src => libunwind/src}/ppc/Linit_local.c | 0 {src => libunwind/src}/ppc/Linit_remote.c | 0 .../src/ppc}/Lis_signal_frame.c | 0 {src => libunwind/src}/ppc/longjmp.S | 0 {src => libunwind/src}/ppc/siglongjmp.S | 0 .../src/ppc32}/Gapply_reg_state.c | 0 .../src}/ppc32/Gcreate_addr_space.c | 0 {src => libunwind/src}/ppc32/Gglobal.c | 0 {src => libunwind/src}/ppc32/Ginit.c | 0 .../src/ppc32}/Greg_states_iterate.c | 0 {src => libunwind/src}/ppc32/Gregs.c | 0 {src => libunwind/src}/ppc32/Gresume.c | 0 {src => libunwind/src}/ppc32/Gstep.c | 0 .../src/ppc32}/Lapply_reg_state.c | 0 .../src}/ppc32/Lcreate_addr_space.c | 0 {src => libunwind/src}/ppc32/Lglobal.c | 0 {src => libunwind/src}/ppc32/Linit.c | 0 .../src/ppc32}/Lreg_states_iterate.c | 0 {src => libunwind/src}/ppc32/Lregs.c | 0 {src => libunwind/src}/ppc32/Lresume.c | 0 {src => libunwind/src}/ppc32/Lstep.c | 0 {src => libunwind/src}/ppc32/get_func_addr.c | 0 {src => libunwind/src}/ppc32/init.h | 0 {src => libunwind/src}/ppc32/is_fpreg.c | 0 {src => libunwind/src}/ppc32/regname.c | 0 {src => libunwind/src}/ppc32/ucontext_i.h | 0 {src => libunwind/src}/ppc32/unwind_i.h | 0 .../src/ppc64}/Gapply_reg_state.c | 0 .../src}/ppc64/Gcreate_addr_space.c | 0 {src => libunwind/src}/ppc64/Gglobal.c | 0 {src => libunwind/src}/ppc64/Ginit.c | 0 .../src/ppc64}/Greg_states_iterate.c | 0 {src => libunwind/src}/ppc64/Gregs.c | 0 {src => libunwind/src}/ppc64/Gresume.c | 0 {src => libunwind/src}/ppc64/Gstep.c | 0 .../src/ppc64}/Lapply_reg_state.c | 0 .../src}/ppc64/Lcreate_addr_space.c | 0 {src => libunwind/src}/ppc64/Lglobal.c | 0 {src => libunwind/src}/ppc64/Linit.c | 0 .../src/ppc64}/Lreg_states_iterate.c | 0 {src => libunwind/src}/ppc64/Lregs.c | 0 {src => libunwind/src}/ppc64/Lresume.c | 0 {src => libunwind/src}/ppc64/Lstep.c | 0 {src => libunwind/src}/ppc64/get_func_addr.c | 0 {src => libunwind/src}/ppc64/init.h | 0 {src => libunwind/src}/ppc64/is_fpreg.c | 0 {src => libunwind/src}/ppc64/regname.c | 0 {src => libunwind/src}/ppc64/ucontext_i.h | 0 {src => libunwind/src}/ppc64/unwind_i.h | 0 .../src}/ptrace/_UPT_access_fpreg.c | 0 .../src}/ptrace/_UPT_access_mem.c | 0 .../src}/ptrace/_UPT_access_reg.c | 6 +- .../src}/ptrace/_UPT_accessors.c | 15 +- {src => libunwind/src}/ptrace/_UPT_create.c | 0 {src => libunwind/src}/ptrace/_UPT_destroy.c | 0 {src => libunwind/src}/ptrace/_UPT_elf.c | 0 .../src}/ptrace/_UPT_find_proc_info.c | 13 +- .../src}/ptrace/_UPT_get_dyn_info_list_addr.c | 2 +- .../src}/ptrace/_UPT_get_proc_name.c | 0 {src => libunwind/src}/ptrace/_UPT_internal.h | 0 .../src}/ptrace/_UPT_put_unwind_info.c | 0 .../src}/ptrace/_UPT_reg_offset.c | 0 {src => libunwind/src}/ptrace/_UPT_resume.c | 0 .../src}/ptrace/libunwind-ptrace.pc.in | 0 .../src}/riscv/Gapply_reg_state.c | 0 .../src}/riscv/Gcreate_addr_space.c | 0 {src => libunwind/src}/riscv/Gget_proc_info.c | 0 {src => libunwind/src}/riscv/Gget_save_loc.c | 0 {src => libunwind/src}/riscv/Gglobal.c | 3 +- {src => libunwind/src}/riscv/Ginit.c | 17 - {src => libunwind/src}/riscv/Ginit_local.c | 17 - {src => libunwind/src}/riscv/Ginit_remote.c | 0 .../src}/riscv/Gis_signal_frame.c | 0 .../src}/riscv/Greg_states_iterate.c | 0 {src => libunwind/src}/riscv/Gregs.c | 0 {src => libunwind/src}/riscv/Gresume.c | 0 {src => libunwind/src}/riscv/Gstep.c | 0 .../src/riscv}/Lapply_reg_state.c | 0 .../src}/riscv/Lcreate_addr_space.c | 0 {src => libunwind/src}/riscv/Lget_proc_info.c | 0 {src => libunwind/src}/riscv/Lget_save_loc.c | 0 {src => libunwind/src}/riscv/Lglobal.c | 0 {src => libunwind/src}/riscv/Linit.c | 0 {src => libunwind/src}/riscv/Linit_local.c | 0 {src => libunwind/src}/riscv/Linit_remote.c | 0 .../src/riscv}/Lis_signal_frame.c | 0 .../src/riscv}/Lreg_states_iterate.c | 0 {src => libunwind/src}/riscv/Lregs.c | 0 {src => libunwind/src}/riscv/Lresume.c | 0 {src => libunwind/src}/riscv/Lstep.c | 0 {src => libunwind/src}/riscv/asm.h | 0 {src => libunwind/src}/riscv/getcontext.S | 0 {src => libunwind/src}/riscv/init.h | 0 {src => libunwind/src}/riscv/is_fpreg.c | 0 {src => libunwind/src}/riscv/offsets.h | 0 {src => libunwind/src}/riscv/regname.c | 0 {src => libunwind/src}/riscv/setcontext.S | 0 {src => libunwind/src}/riscv/siglongjmp.S | 0 {src => libunwind/src}/riscv/unwind_i.h | 1 - .../src/s390x}/Gapply_reg_state.c | 0 .../src}/s390x/Gcreate_addr_space.c | 0 {src => libunwind/src}/s390x/Gget_proc_info.c | 0 {src => libunwind/src}/s390x/Gget_save_loc.c | 0 {src => libunwind/src}/s390x/Gglobal.c | 2 +- {src => libunwind/src}/s390x/Ginit.c | 0 {src => libunwind/src}/s390x/Ginit_local.c | 0 {src => libunwind/src}/s390x/Ginit_remote.c | 0 .../src}/s390x/Gis_signal_frame.c | 0 .../src/s390x}/Greg_states_iterate.c | 0 {src => libunwind/src}/s390x/Gregs.c | 0 {src => libunwind/src}/s390x/Gresume.c | 0 {src => libunwind/src}/s390x/Gstep.c | 0 .../src/s390x}/Lapply_reg_state.c | 0 .../src}/s390x/Lcreate_addr_space.c | 0 {src => libunwind/src}/s390x/Lget_proc_info.c | 0 {src => libunwind/src}/s390x/Lget_save_loc.c | 0 {src => libunwind/src}/s390x/Lglobal.c | 0 {src => libunwind/src}/s390x/Linit.c | 0 {src => libunwind/src}/s390x/Linit_local.c | 0 {src => libunwind/src}/s390x/Linit_remote.c | 0 .../src/s390x}/Lis_signal_frame.c | 0 .../src/s390x}/Lreg_states_iterate.c | 0 {src => libunwind/src}/s390x/Lregs.c | 0 {src => libunwind/src}/s390x/Lresume.c | 0 {src => libunwind/src}/s390x/Lstep.c | 0 {src => libunwind/src}/s390x/getcontext.S | 0 {src => libunwind/src}/s390x/init.h | 0 {src => libunwind/src}/s390x/is_fpreg.c | 0 {src => libunwind/src}/s390x/regname.c | 0 {src => libunwind/src}/s390x/setcontext.S | 0 {src => libunwind/src}/s390x/unwind_i.h | 0 .../src}/setjmp/libunwind-setjmp.pc.in | 0 {src => libunwind/src}/setjmp/longjmp.c | 0 {src => libunwind/src}/setjmp/setjmp_i.h | 0 {src => libunwind/src}/setjmp/siglongjmp.c | 0 .../src/sh}/Gapply_reg_state.c | 0 .../src}/sh/Gcreate_addr_space.c | 0 {src => libunwind/src}/sh/Gget_proc_info.c | 0 {src => libunwind/src}/sh/Gget_save_loc.c | 0 {src => libunwind/src}/sh/Gglobal.c | 0 {src => libunwind/src}/sh/Ginit.c | 0 {src => libunwind/src}/sh/Ginit_local.c | 0 {src/arm => libunwind/src/sh}/Ginit_remote.c | 4 - {src => libunwind/src}/sh/Gis_signal_frame.c | 0 .../src/sh}/Greg_states_iterate.c | 0 {src => libunwind/src}/sh/Gregs.c | 0 {src => libunwind/src}/sh/Gresume.c | 0 {src => libunwind/src}/sh/Gstep.c | 5 +- .../src/sh}/Lapply_reg_state.c | 0 .../src}/sh/Lcreate_addr_space.c | 0 {src => libunwind/src}/sh/Lget_proc_info.c | 0 {src => libunwind/src}/sh/Lget_save_loc.c | 0 {src => libunwind/src}/sh/Lglobal.c | 0 {src => libunwind/src}/sh/Linit.c | 0 {src => libunwind/src}/sh/Linit_local.c | 0 {src => libunwind/src}/sh/Linit_remote.c | 0 .../src/sh}/Lis_signal_frame.c | 0 .../src/sh}/Lreg_states_iterate.c | 0 {src => libunwind/src}/sh/Lregs.c | 0 {src => libunwind/src}/sh/Lresume.c | 0 {src => libunwind/src}/sh/Lstep.c | 0 {src => libunwind/src}/sh/init.h | 0 {src => libunwind/src}/sh/is_fpreg.c | 0 {src => libunwind/src}/sh/offsets.h | 0 {src => libunwind/src}/sh/regname.c | 0 {src => libunwind/src}/sh/siglongjmp.S | 0 {src => libunwind/src}/sh/unwind_i.h | 0 .../src/tilegx}/Gapply_reg_state.c | 0 .../src}/tilegx/Gcreate_addr_space.c | 0 .../src}/tilegx/Gget_proc_info.c | 0 {src => libunwind/src}/tilegx/Gget_save_loc.c | 0 {src => libunwind/src}/tilegx/Gglobal.c | 0 {src => libunwind/src}/tilegx/Ginit.c | 0 {src => libunwind/src}/tilegx/Ginit_local.c | 0 {src => libunwind/src}/tilegx/Ginit_remote.c | 0 .../src}/tilegx/Gis_signal_frame.c | 3 - .../src/tilegx}/Greg_states_iterate.c | 0 {src => libunwind/src}/tilegx/Gregs.c | 0 {src => libunwind/src}/tilegx/Gresume.c | 0 {src => libunwind/src}/tilegx/Gstep.c | 0 .../src/tilegx}/Lapply_reg_state.c | 0 .../src}/tilegx/Lcreate_addr_space.c | 0 .../src}/tilegx/Lget_proc_info.c | 0 {src => libunwind/src}/tilegx/Lget_save_loc.c | 0 {src => libunwind/src}/tilegx/Lglobal.c | 0 {src => libunwind/src}/tilegx/Linit.c | 0 {src => libunwind/src}/tilegx/Linit_local.c | 0 {src => libunwind/src}/tilegx/Linit_remote.c | 0 .../src/tilegx}/Lis_signal_frame.c | 0 .../src/tilegx}/Lreg_states_iterate.c | 0 {src => libunwind/src}/tilegx/Lregs.c | 0 {src => libunwind/src}/tilegx/Lresume.c | 0 {src => libunwind/src}/tilegx/Lstep.c | 0 {src => libunwind/src}/tilegx/getcontext.S | 0 {src => libunwind/src}/tilegx/init.h | 0 {src => libunwind/src}/tilegx/is_fpreg.c | 0 {src => libunwind/src}/tilegx/offsets.h | 0 {src => libunwind/src}/tilegx/regname.c | 0 {src => libunwind/src}/tilegx/siglongjmp.S | 0 {src => libunwind/src}/tilegx/unwind_i.h | 0 {src => libunwind/src}/unwind/Backtrace.c | 0 .../src}/unwind/DeleteException.c | 0 .../src}/unwind/FindEnclosingFunction.c | 0 {src => libunwind/src}/unwind/ForcedUnwind.c | 0 {src => libunwind/src}/unwind/GetBSP.c | 0 {src => libunwind/src}/unwind/GetCFA.c | 0 .../src}/unwind/GetDataRelBase.c | 0 {src => libunwind/src}/unwind/GetGR.c | 0 {src => libunwind/src}/unwind/GetIP.c | 0 {src => libunwind/src}/unwind/GetIPInfo.c | 0 .../src}/unwind/GetLanguageSpecificData.c | 0 .../src}/unwind/GetRegionStart.c | 0 .../src}/unwind/GetTextRelBase.c | 0 .../src}/unwind/RaiseException.c | 0 {src => libunwind/src}/unwind/Resume.c | 0 .../src}/unwind/Resume_or_Rethrow.c | 0 {src => libunwind/src}/unwind/SetGR.c | 0 {src => libunwind/src}/unwind/SetIP.c | 0 {src => libunwind/src}/unwind/libunwind.pc.in | 0 .../src}/unwind/unwind-internal.h | 0 .../src/x86}/Gapply_reg_state.c | 0 .../src}/x86/Gcreate_addr_space.c | 0 {src => libunwind/src}/x86/Gget_proc_info.c | 0 {src => libunwind/src}/x86/Gget_save_loc.c | 0 {src => libunwind/src}/x86/Gglobal.c | 0 {src => libunwind/src}/x86/Ginit.c | 16 - {src => libunwind/src}/x86/Ginit_local.c | 12 - {src => libunwind/src}/x86/Ginit_remote.c | 3 - {src => libunwind/src}/x86/Gos-freebsd.c | 4 - {src => libunwind/src}/x86/Gos-linux.c | 8 +- .../src/x86}/Greg_states_iterate.c | 0 {src => libunwind/src}/x86/Gregs.c | 0 {src => libunwind/src}/x86/Gresume.c | 0 {src => libunwind/src}/x86/Gstep.c | 4 +- .../src/x86}/Lapply_reg_state.c | 0 .../src}/x86/Lcreate_addr_space.c | 0 {src => libunwind/src}/x86/Lget_proc_info.c | 0 {src => libunwind/src}/x86/Lget_save_loc.c | 0 {src => libunwind/src}/x86/Lglobal.c | 0 {src => libunwind/src}/x86/Linit.c | 0 {src => libunwind/src}/x86/Linit_local.c | 0 {src => libunwind/src}/x86/Linit_remote.c | 0 {src => libunwind/src}/x86/Los-freebsd.c | 0 {src => libunwind/src}/x86/Los-linux.c | 0 .../src/x86}/Lreg_states_iterate.c | 0 {src => libunwind/src}/x86/Lregs.c | 0 {src => libunwind/src}/x86/Lresume.c | 0 {src => libunwind/src}/x86/Lstep.c | 0 .../src}/x86/getcontext-freebsd.S | 0 {src => libunwind/src}/x86/getcontext-linux.S | 0 {src => libunwind/src}/x86/init.h | 0 {src => libunwind/src}/x86/is_fpreg.c | 0 {src => libunwind/src}/x86/longjmp.S | 0 {src => libunwind/src}/x86/offsets.h | 0 {src => libunwind/src}/x86/regname.c | 0 {src => libunwind/src}/x86/siglongjmp.S | 0 {src => libunwind/src}/x86/unwind_i.h | 1 - .../src/x86_64}/Gapply_reg_state.c | 0 .../src}/x86_64/Gcreate_addr_space.c | 0 .../src}/x86_64/Gget_proc_info.c | 0 {src => libunwind/src}/x86_64/Gget_save_loc.c | 0 {src => libunwind/src}/x86_64/Gglobal.c | 0 {src => libunwind/src}/x86_64/Ginit.c | 24 +- {src => libunwind/src}/x86_64/Ginit_local.c | 24 +- {src => libunwind/src}/x86_64/Ginit_remote.c | 3 - {src => libunwind/src}/x86_64/Gos-freebsd.c | 40 +- {src => libunwind/src}/x86_64/Gos-linux.c | 0 {src => libunwind/src}/x86_64/Gos-solaris.c | 4 - .../src/x86_64}/Greg_states_iterate.c | 0 {src => libunwind/src}/x86_64/Gregs.c | 0 {src => libunwind/src}/x86_64/Gresume.c | 0 {src => libunwind/src}/x86_64/Gstash_frame.c | 0 {src => libunwind/src}/x86_64/Gstep.c | 8 +- {src => libunwind/src}/x86_64/Gtrace.c | 0 .../src/x86_64}/Lapply_reg_state.c | 0 .../src}/x86_64/Lcreate_addr_space.c | 0 .../src}/x86_64/Lget_proc_info.c | 0 {src => libunwind/src}/x86_64/Lget_save_loc.c | 0 {src => libunwind/src}/x86_64/Lglobal.c | 0 {src => libunwind/src}/x86_64/Linit.c | 0 {src => libunwind/src}/x86_64/Linit_local.c | 0 {src => libunwind/src}/x86_64/Linit_remote.c | 0 {src => libunwind/src}/x86_64/Los-freebsd.c | 0 {src => libunwind/src}/x86_64/Los-linux.c | 0 {src => libunwind/src}/x86_64/Los-solaris.c | 0 .../src/x86_64}/Lreg_states_iterate.c | 0 {src => libunwind/src}/x86_64/Lregs.c | 0 {src => libunwind/src}/x86_64/Lresume.c | 0 {src => libunwind/src}/x86_64/Lstash_frame.c | 0 {src => libunwind/src}/x86_64/Lstep.c | 0 {src => libunwind/src}/x86_64/Ltrace.c | 0 {src => libunwind/src}/x86_64/getcontext.S | 0 {src => libunwind/src}/x86_64/init.h | 0 {src => libunwind/src}/x86_64/is_fpreg.c | 0 {src => libunwind/src}/x86_64/longjmp.S | 0 {src => libunwind/src}/x86_64/offsets.h | 0 {src => libunwind/src}/x86_64/regname.c | 0 {src => libunwind/src}/x86_64/setcontext.S | 0 {src => libunwind/src}/x86_64/siglongjmp.S | 0 {src => libunwind/src}/x86_64/ucontext_i.h | 2 +- {src => libunwind/src}/x86_64/unwind_i.h | 2 +- {tests => libunwind/tests}/Gia64-test-nat.c | 0 {tests => libunwind/tests}/Gia64-test-rbs.c | 0 .../tests}/Gia64-test-readonly.c | 0 {tests => libunwind/tests}/Gia64-test-stack.c | 0 {tests => libunwind/tests}/Gperf-simple.c | 0 {tests => libunwind/tests}/Gperf-trace.c | 0 {tests => libunwind/tests}/Gtest-bt.c | 0 {tests => libunwind/tests}/Gtest-concurrent.c | 0 {tests => libunwind/tests}/Gtest-dyn1.c | 0 {tests => libunwind/tests}/Gtest-exc.c | 0 {tests => libunwind/tests}/Gtest-init.cxx | 0 {tests => libunwind/tests}/Gtest-nomalloc.c | 0 .../tests}/Gtest-resume-sig-rt.c | 0 {tests => libunwind/tests}/Gtest-resume-sig.c | 0 {tests => libunwind/tests}/Gtest-trace.c | 0 .../tests}/Gx64-test-dwarf-expressions.c | 0 {tests => libunwind/tests}/Lia64-test-nat.c | 0 {tests => libunwind/tests}/Lia64-test-rbs.c | 0 .../tests}/Lia64-test-readonly.c | 0 {tests => libunwind/tests}/Lia64-test-stack.c | 0 {tests => libunwind/tests}/Lperf-simple.c | 0 {tests => libunwind/tests}/Lperf-trace.c | 0 {tests => libunwind/tests}/Lrs-race.c | 0 {tests => libunwind/tests}/Ltest-bt.c | 0 {tests => libunwind/tests}/Ltest-concurrent.c | 0 .../tests}/Ltest-cxx-exceptions.cxx | 0 {tests => libunwind/tests}/Ltest-dyn1.c | 0 {tests => libunwind/tests}/Ltest-exc.c | 0 .../tests}/Ltest-init-local-signal-lib.c | 0 .../tests}/Ltest-init-local-signal.c | 0 {tests => libunwind/tests}/Ltest-init.cxx | 0 .../tests}/Ltest-mem-validate.c | 2 +- {tests => libunwind/tests}/Ltest-nocalloc.c | 0 {tests => libunwind/tests}/Ltest-nomalloc.c | 0 .../tests}/Ltest-resume-sig-rt.c | 0 {tests => libunwind/tests}/Ltest-resume-sig.c | 0 {tests => libunwind/tests}/Ltest-trace.c | 0 {tests => libunwind/tests}/Ltest-varargs.c | 0 .../tests}/Lx64-test-dwarf-expressions.c | 0 {tests => libunwind/tests}/Makefile.am | 0 libunwind/tests/check-namespace.sh | 402 ++++++++ .../tests}/check-namespace.sh.in | 46 +- {tests => libunwind/tests}/crasher.c | 0 {tests => libunwind/tests}/flush-cache.S | 0 {tests => libunwind/tests}/flush-cache.h | 0 {tests => libunwind/tests}/forker.c | 0 {tests => libunwind/tests}/ia64-dyn-asm.S | 0 {tests => libunwind/tests}/ia64-test-dyn1.c | 0 .../tests}/ia64-test-nat-asm.S | 0 .../tests}/ia64-test-rbs-asm.S | 0 {tests => libunwind/tests}/ia64-test-rbs.h | 0 .../tests}/ia64-test-readonly-asm.S | 0 {tests => libunwind/tests}/ia64-test-setjmp.c | 0 {tests => libunwind/tests}/ia64-test-sig.c | 0 .../tests}/ia64-test-stack-asm.S | 0 {tests => libunwind/tests}/ia64-test-stack.h | 0 {tests => libunwind/tests}/ident.c | 0 {tests => libunwind/tests}/mapper.c | 11 +- .../tests}/ppc64-test-altivec-utils.c | 0 .../tests}/ppc64-test-altivec.c | 0 .../tests}/run-check-namespace | 0 .../tests}/run-coredump-unwind | 4 + .../tests}/run-coredump-unwind-mdi | 0 {tests => libunwind/tests}/run-ia64-test-dyn1 | 0 {tests => libunwind/tests}/run-ptrace-mapper | 0 {tests => libunwind/tests}/run-ptrace-misc | 0 {tests => libunwind/tests}/test-async-sig.c | 0 .../tests}/test-coredump-unwind.c | 0 {tests => libunwind/tests}/test-flush-cache.c | 0 {tests => libunwind/tests}/test-init-remote.c | 0 {tests => libunwind/tests}/test-mem.c | 0 {tests => libunwind/tests}/test-proc-info.c | 0 {tests => libunwind/tests}/test-ptrace-misc.c | 0 {tests => libunwind/tests}/test-ptrace.c | 6 +- {tests => libunwind/tests}/test-reg-state.c | 0 {tests => libunwind/tests}/test-setjmp.c | 0 .../tests}/test-static-link-gen.c | 0 .../tests}/test-static-link-loc.c | 0 {tests => libunwind/tests}/test-strerror.c | 0 .../tests}/x64-test-dwarf-expressions.S | 0 .../tests}/x64-unwind-badjmp-signal-frame.c | 0 scripts/kernel-diff.sh | 10 - scripts/kernel-files.txt | 19 - scripts/make-L-files | 30 - src/CMakeLists.txt | 332 ------- src/aarch64/gen-offsets.c | 68 -- src/arm/gen-offsets.c | 54 -- src/coredump/README | 8 - src/hppa/get_accessors.c | 38 - src/hppa/tables.c | 43 - src/ia64/NOTES | 65 -- src/mi/Ldyn-remote.c | 5 - src/mi/maps.c | 72 -- src/mingw/pal-single-threaded.c | 118 --- src/mips/elfxx.c | 27 - src/mips/gen-offsets.c | 30 - src/ohos-config.c | 48 - src/os-linux.c | 349 ------- src/os-ohos.c | 341 ------- src/os-ohos.h | 44 - src/ppc32/Make-arch.in | 11 - src/ppc32/setcontext.S | 9 - src/ppc64/setcontext.S | 9 - src/setjmp/setjmp.c | 49 - src/setjmp/sigsetjmp.c | 50 - src/sh/gen-offsets.c | 51 -- src/tilegx/Lis_signal_frame.c | 5 - src/tilegx/elfxx.c | 27 - src/tilegx/gen-offsets.c | 30 - src/win/pal-single-threaded.c | 114 --- src/x86_64/Gapply_reg_state.c | 37 - src/x86_64/Greg_states_iterate.c | 37 - src/x86_64/Lapply_reg_state.c | 5 - src/x86_64/Lreg_states_iterate.c | 5 - tests/dummy_backtrace.c | 21 - tests/perf-startup | 19 - 905 files changed, 2284 insertions(+), 8049 deletions(-) delete mode 100644 CMakeLists.txt delete mode 120000 NOTICE delete mode 100755 autogen.sh create mode 100644 debug.log delete mode 100644 include/config.h.cmake.in delete mode 100644 include/libunwind-common.h delete mode 100644 include/libunwind_i-ohos.h delete mode 100644 include/map_info.h delete mode 100755 include/mingw/elf.h delete mode 100755 include/mingw/endian.h delete mode 100755 include/mingw/freebsd-elf32.h delete mode 100755 include/mingw/freebsd-elf64.h delete mode 100755 include/mingw/freebsd-elf_common.h delete mode 100755 include/mingw/signal.h delete mode 100755 include/mingw/sys/mman.h delete mode 100755 include/mingw/sys/syscall.h delete mode 100755 include/mingw/sys/ucontext.h delete mode 100755 include/mingw/ucontext.h delete mode 100755 include/mingw/unistd.h delete mode 100644 include/ohos-config.h delete mode 100644 include/win/elf.h delete mode 100644 include/win/endian.h delete mode 100644 include/win/fakestdalign.h.in delete mode 100644 include/win/fakestdatomic.h.in delete mode 100644 include/win/freebsd-elf32.h delete mode 100644 include/win/freebsd-elf64.h delete mode 100644 include/win/freebsd-elf_common.h delete mode 100644 include/win/pthread.h delete mode 100644 include/win/signal.h delete mode 100644 include/win/sys/mman.h delete mode 100644 include/win/sys/syscall.h delete mode 100644 include/win/sys/types.h delete mode 100644 include/win/sys/ucontext.h delete mode 100644 include/win/ucontext.h delete mode 100644 include/win/unistd.h delete mode 100644 include/x86/jmpbuf.h create mode 100644 libunwind.spec create mode 100644 libunwind.yaml rename AUTHORS => libunwind/AUTHORS (100%) rename COPYING => libunwind/COPYING (100%) rename ChangeLog => libunwind/ChangeLog (100%) rename Makefile.am => libunwind/Makefile.am (100%) rename NEWS => libunwind/NEWS (100%) create mode 100644 libunwind/README rename TODO => libunwind/TODO (100%) rename acinclude.m4 => libunwind/acinclude.m4 (100%) rename configure.ac => libunwind/configure.ac (98%) rename {doc => libunwind/doc}/Makefile.am (100%) rename {doc => libunwind/doc}/NOTES (100%) rename {doc => libunwind/doc}/_U_dyn_cancel.man (100%) rename {doc => libunwind/doc}/_U_dyn_cancel.tex (100%) rename {doc => libunwind/doc}/_U_dyn_register.man (100%) rename {doc => libunwind/doc}/_U_dyn_register.tex (100%) rename {doc => libunwind/doc}/common.tex.in (100%) rename {doc => libunwind/doc}/libunwind-dynamic.man (100%) rename {doc => libunwind/doc}/libunwind-dynamic.tex (100%) rename {doc => libunwind/doc}/libunwind-ia64.man (100%) rename {doc => libunwind/doc}/libunwind-ia64.tex (100%) rename {doc => libunwind/doc}/libunwind-ptrace.man (100%) rename {doc => libunwind/doc}/libunwind-ptrace.tex (100%) rename {doc => libunwind/doc}/libunwind-setjmp.man (100%) rename {doc => libunwind/doc}/libunwind-setjmp.tex (100%) rename {doc => libunwind/doc}/libunwind.man (100%) rename {doc => libunwind/doc}/libunwind.tex (100%) rename {doc => libunwind/doc}/libunwind.trans (100%) rename {doc => libunwind/doc}/unw_apply_reg_state.man (100%) rename {doc => libunwind/doc}/unw_apply_reg_state.tex (100%) rename {doc => libunwind/doc}/unw_backtrace.man (100%) rename {doc => libunwind/doc}/unw_backtrace.tex (100%) rename {doc => libunwind/doc}/unw_create_addr_space.man (100%) rename {doc => libunwind/doc}/unw_create_addr_space.tex (100%) rename {doc => libunwind/doc}/unw_destroy_addr_space.man (100%) rename {doc => libunwind/doc}/unw_destroy_addr_space.tex (100%) rename {doc => libunwind/doc}/unw_flush_cache.man (100%) rename {doc => libunwind/doc}/unw_flush_cache.tex (100%) rename {doc => libunwind/doc}/unw_get_accessors.man (100%) rename {doc => libunwind/doc}/unw_get_accessors.tex (100%) rename {doc => libunwind/doc}/unw_get_fpreg.man (100%) rename {doc => libunwind/doc}/unw_get_fpreg.tex (100%) rename {doc => libunwind/doc}/unw_get_proc_info.man (100%) rename {doc => libunwind/doc}/unw_get_proc_info.tex (100%) rename {doc => libunwind/doc}/unw_get_proc_info_by_ip.man (100%) rename {doc => libunwind/doc}/unw_get_proc_info_by_ip.tex (100%) rename {doc => libunwind/doc}/unw_get_proc_name.man (90%) rename {doc => libunwind/doc}/unw_get_proc_name.tex (100%) rename {doc => libunwind/doc}/unw_get_reg.man (100%) rename {doc => libunwind/doc}/unw_get_reg.tex (100%) rename {doc => libunwind/doc}/unw_getcontext.man (100%) rename {doc => libunwind/doc}/unw_getcontext.tex (100%) rename {doc => libunwind/doc}/unw_init_local.man (100%) rename {doc => libunwind/doc}/unw_init_local.tex (100%) rename {doc => libunwind/doc}/unw_init_local2.man (100%) rename {doc => libunwind/doc}/unw_init_remote.man (100%) rename {doc => libunwind/doc}/unw_init_remote.tex (100%) rename {doc => libunwind/doc}/unw_is_fpreg.man (100%) rename {doc => libunwind/doc}/unw_is_fpreg.tex (100%) rename {doc => libunwind/doc}/unw_is_signal_frame.man (100%) rename {doc => libunwind/doc}/unw_is_signal_frame.tex (100%) rename {doc => libunwind/doc}/unw_reg_states_iterate.man (100%) rename {doc => libunwind/doc}/unw_reg_states_iterate.tex (100%) rename {doc => libunwind/doc}/unw_regname.man (100%) rename {doc => libunwind/doc}/unw_regname.tex (100%) rename {doc => libunwind/doc}/unw_resume.man (100%) rename {doc => libunwind/doc}/unw_resume.tex (100%) rename {doc => libunwind/doc}/unw_set_cache_size.man (100%) rename {doc => libunwind/doc}/unw_set_cache_size.tex (100%) rename {doc => libunwind/doc}/unw_set_caching_policy.man (100%) rename {doc => libunwind/doc}/unw_set_caching_policy.tex (100%) rename {doc => libunwind/doc}/unw_set_fpreg.man (100%) rename {doc => libunwind/doc}/unw_set_fpreg.tex (100%) rename {doc => libunwind/doc}/unw_set_reg.man (100%) rename {doc => libunwind/doc}/unw_set_reg.tex (100%) rename {doc => libunwind/doc}/unw_step.man (100%) rename {doc => libunwind/doc}/unw_step.tex (100%) rename {doc => libunwind/doc}/unw_strerror.man (100%) rename {doc => libunwind/doc}/unw_strerror.tex (100%) rename {include => libunwind/include}/compiler.h (100%) rename {include => libunwind/include}/config.h (84%) create mode 100644 libunwind/include/config.h.in rename {include => libunwind/include}/dwarf-eh.h (100%) rename {include => libunwind/include}/dwarf.h (95%) rename {include => libunwind/include}/dwarf_i.h (99%) rename {include => libunwind/include}/libunwind-aarch64.h (95%) rename {include => libunwind/include}/libunwind-arm.h (97%) create mode 100644 libunwind/include/libunwind-common.h rename {include => libunwind/include}/libunwind-common.h.in (93%) rename {include => libunwind/include}/libunwind-coredump.h (100%) rename {include => libunwind/include}/libunwind-dynamic.h (99%) rename {include => libunwind/include}/libunwind-hppa.h (100%) rename {include => libunwind/include}/libunwind-ia64.h (100%) rename {include => libunwind/include}/libunwind-mips.h (100%) rename {include => libunwind/include}/libunwind-ppc32.h (100%) rename {include => libunwind/include}/libunwind-ppc64.h (100%) rename {include => libunwind/include}/libunwind-ptrace.h (100%) rename {include => libunwind/include}/libunwind-riscv.h (100%) rename {include => libunwind/include}/libunwind-s390x.h (100%) rename {include => libunwind/include}/libunwind-sh.h (100%) rename {include => libunwind/include}/libunwind-tilegx.h (100%) rename {include => libunwind/include}/libunwind-x86.h (98%) rename {include => libunwind/include}/libunwind-x86_64.h (100%) rename {include => libunwind/include}/libunwind.h (81%) mode change 100755 => 100644 rename {include => libunwind/include}/libunwind.h.in (100%) rename {include => libunwind/include}/libunwind_i.h (87%) rename {include => libunwind/include}/mempool.h (96%) rename {include => libunwind/include}/remote.h (91%) create mode 100644 libunwind/include/stamp-h1 rename {include => libunwind/include}/tdep-aarch64/dwarf-config.h (94%) rename {include => libunwind/include}/tdep-aarch64/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-aarch64/libunwind_i.h (89%) rename {include => libunwind/include}/tdep-arm/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-arm/ex_tables.h (100%) rename {include => libunwind/include}/tdep-arm/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-arm/libunwind_i.h (87%) rename {include => libunwind/include}/tdep-hppa/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-hppa/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-hppa/libunwind_i.h (96%) rename {include => libunwind/include}/tdep-ia64/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-ia64/libunwind_i.h (96%) rename {include => libunwind/include}/tdep-ia64/rse.h (100%) rename {include => libunwind/include}/tdep-ia64/script.h (100%) rename {include => libunwind/include}/tdep-mips/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-mips/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-mips/libunwind_i.h (92%) rename {include => libunwind/include}/tdep-ppc32/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-ppc32/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-ppc32/libunwind_i.h (97%) rename {include => libunwind/include}/tdep-ppc64/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-ppc64/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-ppc64/libunwind_i.h (97%) rename {include => libunwind/include}/tdep-riscv/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-riscv/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-riscv/libunwind_i.h (95%) rename {include => libunwind/include}/tdep-s390x/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-s390x/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-s390x/libunwind_i.h (100%) rename {include => libunwind/include}/tdep-sh/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-sh/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-sh/libunwind_i.h (96%) rename {include => libunwind/include}/tdep-tilegx/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-tilegx/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-tilegx/libunwind_i.h (100%) rename {include => libunwind/include}/tdep-x86/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-x86/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-x86/libunwind_i.h (94%) rename {include => libunwind/include}/tdep-x86_64/dwarf-config.h (100%) rename {include => libunwind/include}/tdep-x86_64/jmpbuf.h (100%) rename {include => libunwind/include}/tdep-x86_64/libunwind_i.h (91%) rename {include => libunwind/include}/tdep/dwarf-config.h (100%) rename {include => libunwind/include}/tdep/jmpbuf.h (100%) rename {include => libunwind/include}/tdep/libunwind_i.h (81%) mode change 100755 => 100644 rename {include => libunwind/include}/tdep/libunwind_i.h.in (100%) rename {include => libunwind/include}/unwind.h (100%) rename {src => libunwind/src}/Makefile.am (99%) rename {src => libunwind/src}/aarch64/Gapply_reg_state.c (100%) rename {src => libunwind/src}/aarch64/Gcreate_addr_space.c (98%) rename {src => libunwind/src}/aarch64/Gget_proc_info.c (100%) rename {src => libunwind/src}/aarch64/Gget_save_loc.c (100%) rename {src => libunwind/src}/aarch64/Gglobal.c (100%) rename {src => libunwind/src}/aarch64/Ginit.c (86%) rename {src => libunwind/src}/aarch64/Ginit_local.c (78%) rename {src => libunwind/src}/aarch64/Ginit_remote.c (95%) rename {src => libunwind/src}/aarch64/Gis_signal_frame.c (100%) rename {src => libunwind/src}/aarch64/Greg_states_iterate.c (100%) rename {src => libunwind/src}/aarch64/Gregs.c (96%) rename {src => libunwind/src}/aarch64/Gresume.c (100%) rename {src => libunwind/src}/aarch64/Gstash_frame.c (100%) rename {src => libunwind/src}/aarch64/Gstep.c (73%) rename {src => libunwind/src}/aarch64/Gtrace.c (100%) rename {src => libunwind/src}/aarch64/Lapply_reg_state.c (100%) rename {src => libunwind/src}/aarch64/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/aarch64/Lget_proc_info.c (100%) rename {src => libunwind/src}/aarch64/Lget_save_loc.c (100%) rename {src => libunwind/src}/aarch64/Lglobal.c (100%) rename {src => libunwind/src}/aarch64/Linit.c (100%) rename {src => libunwind/src}/aarch64/Linit_local.c (100%) rename {src => libunwind/src}/aarch64/Linit_remote.c (100%) rename {src => libunwind/src}/aarch64/Lis_signal_frame.c (100%) rename {src => libunwind/src}/aarch64/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/aarch64/Lregs.c (100%) rename {src => libunwind/src}/aarch64/Lresume.c (100%) rename {src => libunwind/src}/aarch64/Lstash_frame.c (100%) rename {src => libunwind/src}/aarch64/Lstep.c (100%) rename {src => libunwind/src}/aarch64/Ltrace.c (100%) rename {src => libunwind/src}/aarch64/getcontext.S (100%) rename {src => libunwind/src}/aarch64/init.h (99%) rename {src => libunwind/src}/aarch64/is_fpreg.c (100%) rename {src => libunwind/src}/aarch64/offsets.h (100%) rename {src => libunwind/src}/aarch64/regname.c (100%) rename {src => libunwind/src}/aarch64/siglongjmp.S (100%) rename {src => libunwind/src}/aarch64/unwind_i.h (97%) rename {src => libunwind/src}/arm/Gapply_reg_state.c (100%) rename {src => libunwind/src}/arm/Gcreate_addr_space.c (97%) rename {src => libunwind/src}/arm/Gex_tables.c (96%) rename {src => libunwind/src}/arm/Gget_proc_info.c (100%) rename {src => libunwind/src}/arm/Gget_save_loc.c (100%) rename {src => libunwind/src}/arm/Gglobal.c (98%) rename {src => libunwind/src}/arm/Ginit.c (53%) rename {src => libunwind/src}/arm/Ginit_local.c (77%) rename {src/mips => libunwind/src/arm}/Ginit_remote.c (100%) rename {src => libunwind/src}/arm/Gos-freebsd.c (97%) rename {src => libunwind/src}/arm/Gos-linux.c (98%) rename {src => libunwind/src}/arm/Gos-other.c (100%) rename {src => libunwind/src}/arm/Greg_states_iterate.c (100%) rename {src => libunwind/src}/arm/Gregs.c (100%) rename {src => libunwind/src}/arm/Gresume.c (100%) rename {src => libunwind/src}/arm/Gstash_frame.c (100%) rename {src => libunwind/src}/arm/Gstep.c (86%) rename {src => libunwind/src}/arm/Gtrace.c (99%) rename {src => libunwind/src}/arm/Lapply_reg_state.c (100%) rename {src => libunwind/src}/arm/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/arm/Lex_tables.c (100%) rename {src => libunwind/src}/arm/Lget_proc_info.c (100%) rename {src => libunwind/src}/arm/Lget_save_loc.c (100%) rename {src => libunwind/src}/arm/Lglobal.c (100%) rename {src => libunwind/src}/arm/Linit.c (100%) rename {src => libunwind/src}/arm/Linit_local.c (100%) rename {src => libunwind/src}/arm/Linit_remote.c (100%) rename {src => libunwind/src}/arm/Los-freebsd.c (100%) rename {src => libunwind/src}/arm/Los-linux.c (100%) rename {src => libunwind/src}/arm/Los-other.c (100%) rename {src => libunwind/src}/arm/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/arm/Lregs.c (100%) rename {src => libunwind/src}/arm/Lresume.c (100%) rename {src => libunwind/src}/arm/Lstash_frame.c (100%) rename {src => libunwind/src}/arm/Lstep.c (100%) rename {src => libunwind/src}/arm/Ltrace.c (100%) rename {src => libunwind/src}/arm/getcontext.S (100%) rename {src => libunwind/src}/arm/init.h (98%) rename {src => libunwind/src}/arm/is_fpreg.c (100%) rename {src => libunwind/src}/arm/offsets.h (100%) rename {src => libunwind/src}/arm/regname.c (100%) rename {src => libunwind/src}/arm/siglongjmp.S (100%) rename {src => libunwind/src}/arm/unwind_i.h (97%) rename {src => libunwind/src}/coredump/_UCD_access_mem.c (100%) rename {src => libunwind/src}/coredump/_UCD_access_reg_freebsd.c (100%) rename {src => libunwind/src}/coredump/_UCD_access_reg_linux.c (100%) rename {src => libunwind/src}/coredump/_UCD_accessors.c (100%) rename {src => libunwind/src}/coredump/_UCD_corefile_elf.c (100%) rename {src => libunwind/src}/coredump/_UCD_create.c (100%) rename {src => libunwind/src}/coredump/_UCD_destroy.c (100%) rename {src => libunwind/src}/coredump/_UCD_elf_map_image.c (100%) rename {src => libunwind/src}/coredump/_UCD_find_proc_info.c (100%) rename {src => libunwind/src}/coredump/_UCD_get_mapinfo_generic.c (100%) rename {src => libunwind/src}/coredump/_UCD_get_mapinfo_linux.c (100%) rename {src => libunwind/src}/coredump/_UCD_get_proc_name.c (100%) rename {src => libunwind/src}/coredump/_UCD_get_threadinfo_prstatus.c (100%) rename {src => libunwind/src}/coredump/_UCD_internal.h (100%) rename {src => libunwind/src}/coredump/_UCD_lib.h (100%) rename {src => libunwind/src}/coredump/_UPT_access_fpreg.c (100%) rename {src => libunwind/src}/coredump/_UPT_elf.c (100%) rename {src => libunwind/src}/coredump/_UPT_get_dyn_info_list_addr.c (100%) rename {src => libunwind/src}/coredump/_UPT_put_unwind_info.c (100%) rename {src => libunwind/src}/coredump/_UPT_resume.c (100%) rename {src => libunwind/src}/coredump/libunwind-coredump.pc.in (100%) rename {src => libunwind/src}/dl-iterate-phdr.c (100%) rename {src => libunwind/src}/dwarf/Gexpr.c (99%) rename {src => libunwind/src}/dwarf/Gfde.c (97%) rename {src => libunwind/src}/dwarf/Gfind_proc_info-lsb.c (98%) rename {src => libunwind/src}/dwarf/Gfind_unwind_table.c (55%) rename {src => libunwind/src}/dwarf/Gparser.c (89%) rename {src => libunwind/src}/dwarf/Gpe.c (100%) rename {src => libunwind/src}/dwarf/Lexpr.c (100%) rename {src => libunwind/src}/dwarf/Lfde.c (100%) rename {src => libunwind/src}/dwarf/Lfind_proc_info-lsb.c (100%) rename {src => libunwind/src}/dwarf/Lfind_unwind_table.c (100%) rename {src => libunwind/src}/dwarf/Lparser.c (100%) rename {src => libunwind/src}/dwarf/Lpe.c (100%) rename {src => libunwind/src}/dwarf/global.c (100%) rename {src => libunwind/src}/elf32.c (100%) rename {src => libunwind/src}/elf32.h (100%) rename {src => libunwind/src}/elf64.c (100%) rename {src => libunwind/src}/elf64.h (100%) rename {src => libunwind/src}/elfxx.c (75%) rename {src => libunwind/src}/elfxx.h (83%) rename {src => libunwind/src}/hppa/Gapply_reg_state.c (100%) rename {src => libunwind/src}/hppa/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/hppa/Gget_proc_info.c (100%) rename {src => libunwind/src}/hppa/Gget_save_loc.c (100%) rename {src => libunwind/src}/hppa/Gglobal.c (100%) rename {src => libunwind/src}/hppa/Ginit.c (100%) rename {src => libunwind/src}/hppa/Ginit_local.c (100%) rename {src => libunwind/src}/hppa/Ginit_remote.c (100%) rename {src => libunwind/src}/hppa/Gis_signal_frame.c (100%) rename {src => libunwind/src}/hppa/Greg_states_iterate.c (100%) rename {src => libunwind/src}/hppa/Gregs.c (100%) rename {src => libunwind/src}/hppa/Gresume.c (100%) rename {src => libunwind/src}/hppa/Gstep.c (100%) rename {src => libunwind/src}/hppa/Lapply_reg_state.c (100%) rename {src => libunwind/src}/hppa/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/hppa/Lget_proc_info.c (100%) rename {src => libunwind/src}/hppa/Lget_save_loc.c (100%) rename {src => libunwind/src}/hppa/Lglobal.c (100%) rename {src => libunwind/src}/hppa/Linit.c (100%) rename {src => libunwind/src}/hppa/Linit_local.c (100%) rename {src => libunwind/src}/hppa/Linit_remote.c (100%) rename {src/arm => libunwind/src/hppa}/Lis_signal_frame.c (100%) rename {src => libunwind/src}/hppa/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/hppa/Lregs.c (100%) rename {src => libunwind/src}/hppa/Lresume.c (100%) rename {src => libunwind/src}/hppa/Lstep.c (100%) rename {src => libunwind/src}/hppa/getcontext.S (100%) rename {src => libunwind/src}/hppa/init.h (100%) rename {src => libunwind/src}/hppa/offsets.h (100%) rename {src => libunwind/src}/hppa/regname.c (100%) rename {src => libunwind/src}/hppa/setcontext.S (100%) rename {src => libunwind/src}/hppa/siglongjmp.S (100%) rename {src => libunwind/src}/hppa/unwind_i.h (100%) rename {src => libunwind/src}/ia64/Gapply_reg_state.c (100%) rename {src => libunwind/src}/ia64/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/ia64/Gfind_unwind_table.c (100%) rename {src => libunwind/src}/ia64/Gget_proc_info.c (100%) rename {src => libunwind/src}/ia64/Gget_save_loc.c (100%) rename {src => libunwind/src}/ia64/Gglobal.c (100%) rename {src => libunwind/src}/ia64/Ginit.c (100%) rename {src => libunwind/src}/ia64/Ginit_local.c (100%) rename {src => libunwind/src}/ia64/Ginit_remote.c (100%) rename {src => libunwind/src}/ia64/Ginstall_cursor.S (100%) rename {src => libunwind/src}/ia64/Gis_signal_frame.c (100%) rename {src => libunwind/src}/ia64/Gparser.c (100%) rename {src => libunwind/src}/ia64/Grbs.c (100%) rename {src => libunwind/src}/ia64/Greg_states_iterate.c (100%) rename {src => libunwind/src}/ia64/Gregs.c (100%) rename {src => libunwind/src}/ia64/Gresume.c (100%) rename {src => libunwind/src}/ia64/Gscript.c (100%) rename {src => libunwind/src}/ia64/Gstep.c (100%) rename {src => libunwind/src}/ia64/Gtables.c (100%) rename {src => libunwind/src}/ia64/Lapply_reg_state.c (100%) rename {src => libunwind/src}/ia64/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/ia64/Lfind_unwind_table.c (100%) rename {src => libunwind/src}/ia64/Lget_proc_info.c (100%) rename {src => libunwind/src}/ia64/Lget_save_loc.c (100%) rename {src => libunwind/src}/ia64/Lglobal.c (100%) rename {src => libunwind/src}/ia64/Linit.c (100%) rename {src => libunwind/src}/ia64/Linit_local.c (100%) rename {src => libunwind/src}/ia64/Linit_remote.c (100%) rename {src => libunwind/src}/ia64/Linstall_cursor.S (100%) rename {src/hppa => libunwind/src/ia64}/Lis_signal_frame.c (100%) rename {src => libunwind/src}/ia64/Lparser.c (100%) rename {src => libunwind/src}/ia64/Lrbs.c (100%) rename {src => libunwind/src}/ia64/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/ia64/Lregs.c (100%) rename {src => libunwind/src}/ia64/Lresume.c (100%) rename {src => libunwind/src}/ia64/Lscript.c (100%) rename {src => libunwind/src}/ia64/Lstep.c (100%) rename {src => libunwind/src}/ia64/Ltables.c (100%) rename {src => libunwind/src}/ia64/dyn_info_list.S (100%) rename {src => libunwind/src}/ia64/getcontext.S (100%) rename {src => libunwind/src}/ia64/init.h (100%) rename {src => libunwind/src}/ia64/longjmp.S (100%) rename {src => libunwind/src}/ia64/mk_Gcursor_i.c (100%) rename {src => libunwind/src}/ia64/mk_Lcursor_i.c (100%) rename {src => libunwind/src}/ia64/mk_cursor_i (100%) rename {src => libunwind/src}/ia64/offsets.h (100%) rename {src => libunwind/src}/ia64/regname.c (100%) rename {src => libunwind/src}/ia64/regs.h (100%) rename {src => libunwind/src}/ia64/setjmp.S (100%) rename {src => libunwind/src}/ia64/siglongjmp.S (100%) rename {src => libunwind/src}/ia64/sigsetjmp.S (100%) rename {src => libunwind/src}/ia64/ucontext_i.h (100%) rename {src => libunwind/src}/ia64/unwind_decoder.h (100%) rename {src => libunwind/src}/ia64/unwind_i.h (100%) rename {src => libunwind/src}/libunwind-generic.pc.in (100%) rename {src => libunwind/src}/mi/Gdestroy_addr_space.c (91%) rename {src => libunwind/src}/mi/Gdyn-extract.c (100%) rename {src => libunwind/src}/mi/Gdyn-remote.c (100%) rename {src => libunwind/src}/mi/Gfind_dynamic_proc_info.c (100%) rename {src => libunwind/src}/mi/Gget_accessors.c (100%) rename {src => libunwind/src}/mi/Gget_fpreg.c (100%) rename {src => libunwind/src}/mi/Gget_proc_info_by_ip.c (100%) rename {src => libunwind/src}/mi/Gget_proc_name.c (100%) rename {src => libunwind/src}/mi/Gget_reg.c (100%) rename {src => libunwind/src}/mi/Gput_dynamic_unwind_info.c (100%) rename {src => libunwind/src}/mi/Gset_cache_size.c (100%) rename {src => libunwind/src}/mi/Gset_caching_policy.c (100%) rename {src => libunwind/src}/mi/Gset_fpreg.c (100%) rename {src => libunwind/src}/mi/Gset_reg.c (100%) rename {src => libunwind/src}/mi/Ldestroy_addr_space.c (100%) rename {src => libunwind/src}/mi/Ldyn-extract.c (100%) rename {src => libunwind/src}/mi/Lfind_dynamic_proc_info.c (100%) rename {src => libunwind/src}/mi/Lget_accessors.c (100%) rename {src => libunwind/src}/mi/Lget_fpreg.c (100%) rename {src => libunwind/src}/mi/Lget_proc_info_by_ip.c (100%) rename {src => libunwind/src}/mi/Lget_proc_name.c (100%) rename {src => libunwind/src}/mi/Lget_reg.c (100%) rename {src => libunwind/src}/mi/Lput_dynamic_unwind_info.c (100%) rename {src => libunwind/src}/mi/Lset_cache_size.c (100%) rename {src => libunwind/src}/mi/Lset_caching_policy.c (100%) rename {src => libunwind/src}/mi/Lset_fpreg.c (100%) rename {src => libunwind/src}/mi/Lset_reg.c (100%) rename {src => libunwind/src}/mi/_ReadSLEB.c (100%) rename {src => libunwind/src}/mi/_ReadULEB.c (100%) rename {src => libunwind/src}/mi/backtrace.c (100%) rename {src => libunwind/src}/mi/dyn-cancel.c (100%) rename {src => libunwind/src}/mi/dyn-info-list.c (100%) rename {src => libunwind/src}/mi/dyn-register.c (100%) rename {src => libunwind/src}/mi/flush_cache.c (100%) rename {src => libunwind/src}/mi/init.c (93%) rename {src => libunwind/src}/mi/mempool.c (97%) rename {src => libunwind/src}/mi/strerror.c (100%) rename {src => libunwind/src}/mips/Gapply_reg_state.c (100%) rename {src => libunwind/src}/mips/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/mips/Gget_proc_info.c (100%) rename {src => libunwind/src}/mips/Gget_save_loc.c (100%) rename {src => libunwind/src}/mips/Gglobal.c (100%) rename {src => libunwind/src}/mips/Ginit.c (100%) rename {src => libunwind/src}/mips/Ginit_local.c (100%) rename {src/sh => libunwind/src/mips}/Ginit_remote.c (100%) rename {src => libunwind/src}/mips/Gis_signal_frame.c (100%) rename {src => libunwind/src}/mips/Greg_states_iterate.c (100%) rename {src => libunwind/src}/mips/Gregs.c (100%) rename {src => libunwind/src}/mips/Gresume.c (100%) rename {src => libunwind/src}/mips/Gstep.c (98%) rename {src => libunwind/src}/mips/Lapply_reg_state.c (100%) rename {src => libunwind/src}/mips/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/mips/Lget_proc_info.c (100%) rename {src => libunwind/src}/mips/Lget_save_loc.c (100%) rename {src => libunwind/src}/mips/Lglobal.c (100%) rename {src => libunwind/src}/mips/Linit.c (100%) rename {src => libunwind/src}/mips/Linit_local.c (100%) rename {src => libunwind/src}/mips/Linit_remote.c (100%) rename {src/ia64 => libunwind/src/mips}/Lis_signal_frame.c (100%) rename {src => libunwind/src}/mips/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/mips/Lregs.c (100%) rename {src => libunwind/src}/mips/Lresume.c (100%) rename {src => libunwind/src}/mips/Lstep.c (100%) rename {src => libunwind/src}/mips/getcontext.S (100%) rename {src => libunwind/src}/mips/init.h (100%) rename {src => libunwind/src}/mips/is_fpreg.c (100%) rename {src => libunwind/src}/mips/offsets.h (100%) rename {src => libunwind/src}/mips/regname.c (100%) rename {src => libunwind/src}/mips/siglongjmp.S (100%) rename {src => libunwind/src}/mips/unwind_i.h (100%) rename {src => libunwind/src}/os-freebsd.c (100%) rename {src => libunwind/src}/os-hpux.c (100%) create mode 100644 libunwind/src/os-linux.c rename {src => libunwind/src}/os-linux.h (93%) rename {src => libunwind/src}/os-qnx.c (100%) rename {src => libunwind/src}/os-solaris.c (100%) rename {src => libunwind/src}/ppc/Gget_proc_info.c (100%) rename {src => libunwind/src}/ppc/Gget_save_loc.c (100%) rename {src => libunwind/src}/ppc/Ginit_local.c (100%) rename {src => libunwind/src}/ppc/Ginit_remote.c (100%) rename {src => libunwind/src}/ppc/Gis_signal_frame.c (100%) rename {src => libunwind/src}/ppc/Lget_proc_info.c (100%) rename {src => libunwind/src}/ppc/Lget_save_loc.c (100%) rename {src => libunwind/src}/ppc/Linit_local.c (100%) rename {src => libunwind/src}/ppc/Linit_remote.c (100%) rename {src/mips => libunwind/src/ppc}/Lis_signal_frame.c (100%) rename {src => libunwind/src}/ppc/longjmp.S (100%) rename {src => libunwind/src}/ppc/siglongjmp.S (100%) rename {src/ppc => libunwind/src/ppc32}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/ppc32/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/ppc32/Gglobal.c (100%) rename {src => libunwind/src}/ppc32/Ginit.c (100%) rename {src/ppc => libunwind/src/ppc32}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/ppc32/Gregs.c (100%) rename {src => libunwind/src}/ppc32/Gresume.c (100%) rename {src => libunwind/src}/ppc32/Gstep.c (100%) rename {src/ppc => libunwind/src/ppc32}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/ppc32/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/ppc32/Lglobal.c (100%) rename {src => libunwind/src}/ppc32/Linit.c (100%) rename {src/ppc => libunwind/src/ppc32}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/ppc32/Lregs.c (100%) rename {src => libunwind/src}/ppc32/Lresume.c (100%) rename {src => libunwind/src}/ppc32/Lstep.c (100%) rename {src => libunwind/src}/ppc32/get_func_addr.c (100%) rename {src => libunwind/src}/ppc32/init.h (100%) rename {src => libunwind/src}/ppc32/is_fpreg.c (100%) rename {src => libunwind/src}/ppc32/regname.c (100%) rename {src => libunwind/src}/ppc32/ucontext_i.h (100%) rename {src => libunwind/src}/ppc32/unwind_i.h (100%) rename {src/ppc32 => libunwind/src/ppc64}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/ppc64/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/ppc64/Gglobal.c (100%) rename {src => libunwind/src}/ppc64/Ginit.c (100%) rename {src/ppc32 => libunwind/src/ppc64}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/ppc64/Gregs.c (100%) rename {src => libunwind/src}/ppc64/Gresume.c (100%) rename {src => libunwind/src}/ppc64/Gstep.c (100%) rename {src/ppc32 => libunwind/src/ppc64}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/ppc64/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/ppc64/Lglobal.c (100%) rename {src => libunwind/src}/ppc64/Linit.c (100%) rename {src/ppc32 => libunwind/src/ppc64}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/ppc64/Lregs.c (100%) rename {src => libunwind/src}/ppc64/Lresume.c (100%) rename {src => libunwind/src}/ppc64/Lstep.c (100%) rename {src => libunwind/src}/ppc64/get_func_addr.c (100%) rename {src => libunwind/src}/ppc64/init.h (100%) rename {src => libunwind/src}/ppc64/is_fpreg.c (100%) rename {src => libunwind/src}/ppc64/regname.c (100%) rename {src => libunwind/src}/ppc64/ucontext_i.h (100%) rename {src => libunwind/src}/ppc64/unwind_i.h (100%) rename {src => libunwind/src}/ptrace/_UPT_access_fpreg.c (100%) rename {src => libunwind/src}/ptrace/_UPT_access_mem.c (100%) rename {src => libunwind/src}/ptrace/_UPT_access_reg.c (97%) rename {src => libunwind/src}/ptrace/_UPT_accessors.c (82%) rename {src => libunwind/src}/ptrace/_UPT_create.c (100%) rename {src => libunwind/src}/ptrace/_UPT_destroy.c (100%) rename {src => libunwind/src}/ptrace/_UPT_elf.c (100%) rename {src => libunwind/src}/ptrace/_UPT_find_proc_info.c (92%) rename {src => libunwind/src}/ptrace/_UPT_get_dyn_info_list_addr.c (98%) rename {src => libunwind/src}/ptrace/_UPT_get_proc_name.c (100%) rename {src => libunwind/src}/ptrace/_UPT_internal.h (100%) mode change 100755 => 100644 rename {src => libunwind/src}/ptrace/_UPT_put_unwind_info.c (100%) rename {src => libunwind/src}/ptrace/_UPT_reg_offset.c (100%) rename {src => libunwind/src}/ptrace/_UPT_resume.c (100%) rename {src => libunwind/src}/ptrace/libunwind-ptrace.pc.in (100%) rename {src => libunwind/src}/riscv/Gapply_reg_state.c (100%) rename {src => libunwind/src}/riscv/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/riscv/Gget_proc_info.c (100%) rename {src => libunwind/src}/riscv/Gget_save_loc.c (100%) rename {src => libunwind/src}/riscv/Gglobal.c (99%) rename {src => libunwind/src}/riscv/Ginit.c (94%) rename {src => libunwind/src}/riscv/Ginit_local.c (86%) rename {src => libunwind/src}/riscv/Ginit_remote.c (100%) rename {src => libunwind/src}/riscv/Gis_signal_frame.c (100%) rename {src => libunwind/src}/riscv/Greg_states_iterate.c (100%) rename {src => libunwind/src}/riscv/Gregs.c (100%) rename {src => libunwind/src}/riscv/Gresume.c (100%) rename {src => libunwind/src}/riscv/Gstep.c (100%) rename {src/ppc64 => libunwind/src/riscv}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/riscv/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/riscv/Lget_proc_info.c (100%) rename {src => libunwind/src}/riscv/Lget_save_loc.c (100%) rename {src => libunwind/src}/riscv/Lglobal.c (100%) rename {src => libunwind/src}/riscv/Linit.c (100%) rename {src => libunwind/src}/riscv/Linit_local.c (100%) rename {src => libunwind/src}/riscv/Linit_remote.c (100%) rename {src/ppc => libunwind/src/riscv}/Lis_signal_frame.c (100%) rename {src/ppc64 => libunwind/src/riscv}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/riscv/Lregs.c (100%) rename {src => libunwind/src}/riscv/Lresume.c (100%) rename {src => libunwind/src}/riscv/Lstep.c (100%) rename {src => libunwind/src}/riscv/asm.h (100%) rename {src => libunwind/src}/riscv/getcontext.S (100%) rename {src => libunwind/src}/riscv/init.h (100%) rename {src => libunwind/src}/riscv/is_fpreg.c (100%) rename {src => libunwind/src}/riscv/offsets.h (100%) rename {src => libunwind/src}/riscv/regname.c (100%) rename {src => libunwind/src}/riscv/setcontext.S (100%) rename {src => libunwind/src}/riscv/siglongjmp.S (100%) rename {src => libunwind/src}/riscv/unwind_i.h (96%) rename {src/ppc64 => libunwind/src/s390x}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/s390x/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/s390x/Gget_proc_info.c (100%) rename {src => libunwind/src}/s390x/Gget_save_loc.c (100%) rename {src => libunwind/src}/s390x/Gglobal.c (100%) rename {src => libunwind/src}/s390x/Ginit.c (100%) rename {src => libunwind/src}/s390x/Ginit_local.c (100%) rename {src => libunwind/src}/s390x/Ginit_remote.c (100%) rename {src => libunwind/src}/s390x/Gis_signal_frame.c (100%) rename {src/ppc64 => libunwind/src/s390x}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/s390x/Gregs.c (100%) rename {src => libunwind/src}/s390x/Gresume.c (100%) rename {src => libunwind/src}/s390x/Gstep.c (100%) rename {src/riscv => libunwind/src/s390x}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/s390x/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/s390x/Lget_proc_info.c (100%) rename {src => libunwind/src}/s390x/Lget_save_loc.c (100%) rename {src => libunwind/src}/s390x/Lglobal.c (100%) rename {src => libunwind/src}/s390x/Linit.c (100%) rename {src => libunwind/src}/s390x/Linit_local.c (100%) rename {src => libunwind/src}/s390x/Linit_remote.c (100%) rename {src/riscv => libunwind/src/s390x}/Lis_signal_frame.c (100%) rename {src/riscv => libunwind/src/s390x}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/s390x/Lregs.c (100%) rename {src => libunwind/src}/s390x/Lresume.c (100%) rename {src => libunwind/src}/s390x/Lstep.c (100%) rename {src => libunwind/src}/s390x/getcontext.S (100%) rename {src => libunwind/src}/s390x/init.h (100%) rename {src => libunwind/src}/s390x/is_fpreg.c (100%) rename {src => libunwind/src}/s390x/regname.c (100%) rename {src => libunwind/src}/s390x/setcontext.S (100%) rename {src => libunwind/src}/s390x/unwind_i.h (100%) rename {src => libunwind/src}/setjmp/libunwind-setjmp.pc.in (100%) rename {src => libunwind/src}/setjmp/longjmp.c (100%) rename {src => libunwind/src}/setjmp/setjmp_i.h (100%) rename {src => libunwind/src}/setjmp/siglongjmp.c (100%) rename {src/s390x => libunwind/src/sh}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/sh/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/sh/Gget_proc_info.c (100%) rename {src => libunwind/src}/sh/Gget_save_loc.c (100%) rename {src => libunwind/src}/sh/Gglobal.c (100%) rename {src => libunwind/src}/sh/Ginit.c (100%) rename {src => libunwind/src}/sh/Ginit_local.c (100%) rename {src/arm => libunwind/src/sh}/Ginit_remote.c (93%) rename {src => libunwind/src}/sh/Gis_signal_frame.c (100%) rename {src/s390x => libunwind/src/sh}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/sh/Gregs.c (100%) rename {src => libunwind/src}/sh/Gresume.c (100%) rename {src => libunwind/src}/sh/Gstep.c (97%) rename {src/s390x => libunwind/src/sh}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/sh/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/sh/Lget_proc_info.c (100%) rename {src => libunwind/src}/sh/Lget_save_loc.c (100%) rename {src => libunwind/src}/sh/Lglobal.c (100%) rename {src => libunwind/src}/sh/Linit.c (100%) rename {src => libunwind/src}/sh/Linit_local.c (100%) rename {src => libunwind/src}/sh/Linit_remote.c (100%) rename {src/s390x => libunwind/src/sh}/Lis_signal_frame.c (100%) rename {src/s390x => libunwind/src/sh}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/sh/Lregs.c (100%) rename {src => libunwind/src}/sh/Lresume.c (100%) rename {src => libunwind/src}/sh/Lstep.c (100%) rename {src => libunwind/src}/sh/init.h (100%) rename {src => libunwind/src}/sh/is_fpreg.c (100%) rename {src => libunwind/src}/sh/offsets.h (100%) rename {src => libunwind/src}/sh/regname.c (100%) rename {src => libunwind/src}/sh/siglongjmp.S (100%) rename {src => libunwind/src}/sh/unwind_i.h (100%) rename {src/sh => libunwind/src/tilegx}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/tilegx/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/tilegx/Gget_proc_info.c (100%) rename {src => libunwind/src}/tilegx/Gget_save_loc.c (100%) rename {src => libunwind/src}/tilegx/Gglobal.c (100%) rename {src => libunwind/src}/tilegx/Ginit.c (100%) rename {src => libunwind/src}/tilegx/Ginit_local.c (100%) rename {src => libunwind/src}/tilegx/Ginit_remote.c (100%) rename {src => libunwind/src}/tilegx/Gis_signal_frame.c (97%) rename {src/sh => libunwind/src/tilegx}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/tilegx/Gregs.c (100%) rename {src => libunwind/src}/tilegx/Gresume.c (100%) rename {src => libunwind/src}/tilegx/Gstep.c (100%) rename {src/sh => libunwind/src/tilegx}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/tilegx/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/tilegx/Lget_proc_info.c (100%) rename {src => libunwind/src}/tilegx/Lget_save_loc.c (100%) rename {src => libunwind/src}/tilegx/Lglobal.c (100%) rename {src => libunwind/src}/tilegx/Linit.c (100%) rename {src => libunwind/src}/tilegx/Linit_local.c (100%) rename {src => libunwind/src}/tilegx/Linit_remote.c (100%) rename {src/sh => libunwind/src/tilegx}/Lis_signal_frame.c (100%) rename {src/sh => libunwind/src/tilegx}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/tilegx/Lregs.c (100%) rename {src => libunwind/src}/tilegx/Lresume.c (100%) rename {src => libunwind/src}/tilegx/Lstep.c (100%) rename {src => libunwind/src}/tilegx/getcontext.S (100%) rename {src => libunwind/src}/tilegx/init.h (100%) rename {src => libunwind/src}/tilegx/is_fpreg.c (100%) rename {src => libunwind/src}/tilegx/offsets.h (100%) rename {src => libunwind/src}/tilegx/regname.c (100%) rename {src => libunwind/src}/tilegx/siglongjmp.S (100%) rename {src => libunwind/src}/tilegx/unwind_i.h (100%) rename {src => libunwind/src}/unwind/Backtrace.c (100%) rename {src => libunwind/src}/unwind/DeleteException.c (100%) rename {src => libunwind/src}/unwind/FindEnclosingFunction.c (100%) rename {src => libunwind/src}/unwind/ForcedUnwind.c (100%) rename {src => libunwind/src}/unwind/GetBSP.c (100%) rename {src => libunwind/src}/unwind/GetCFA.c (100%) rename {src => libunwind/src}/unwind/GetDataRelBase.c (100%) rename {src => libunwind/src}/unwind/GetGR.c (100%) rename {src => libunwind/src}/unwind/GetIP.c (100%) rename {src => libunwind/src}/unwind/GetIPInfo.c (100%) rename {src => libunwind/src}/unwind/GetLanguageSpecificData.c (100%) rename {src => libunwind/src}/unwind/GetRegionStart.c (100%) rename {src => libunwind/src}/unwind/GetTextRelBase.c (100%) rename {src => libunwind/src}/unwind/RaiseException.c (100%) rename {src => libunwind/src}/unwind/Resume.c (100%) rename {src => libunwind/src}/unwind/Resume_or_Rethrow.c (100%) rename {src => libunwind/src}/unwind/SetGR.c (100%) rename {src => libunwind/src}/unwind/SetIP.c (100%) rename {src => libunwind/src}/unwind/libunwind.pc.in (100%) rename {src => libunwind/src}/unwind/unwind-internal.h (100%) rename {src/tilegx => libunwind/src/x86}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/x86/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/x86/Gget_proc_info.c (100%) rename {src => libunwind/src}/x86/Gget_save_loc.c (100%) rename {src => libunwind/src}/x86/Gglobal.c (100%) rename {src => libunwind/src}/x86/Ginit.c (92%) rename {src => libunwind/src}/x86/Ginit_local.c (88%) rename {src => libunwind/src}/x86/Ginit_remote.c (96%) rename {src => libunwind/src}/x86/Gos-freebsd.c (98%) rename {src => libunwind/src}/x86/Gos-linux.c (98%) rename {src/tilegx => libunwind/src/x86}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/x86/Gregs.c (100%) rename {src => libunwind/src}/x86/Gresume.c (100%) rename {src => libunwind/src}/x86/Gstep.c (96%) rename {src/tilegx => libunwind/src/x86}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/x86/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/x86/Lget_proc_info.c (100%) rename {src => libunwind/src}/x86/Lget_save_loc.c (100%) rename {src => libunwind/src}/x86/Lglobal.c (100%) rename {src => libunwind/src}/x86/Linit.c (100%) rename {src => libunwind/src}/x86/Linit_local.c (100%) rename {src => libunwind/src}/x86/Linit_remote.c (100%) rename {src => libunwind/src}/x86/Los-freebsd.c (100%) rename {src => libunwind/src}/x86/Los-linux.c (100%) rename {src/tilegx => libunwind/src/x86}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/x86/Lregs.c (100%) rename {src => libunwind/src}/x86/Lresume.c (100%) rename {src => libunwind/src}/x86/Lstep.c (100%) rename {src => libunwind/src}/x86/getcontext-freebsd.S (100%) rename {src => libunwind/src}/x86/getcontext-linux.S (100%) rename {src => libunwind/src}/x86/init.h (100%) rename {src => libunwind/src}/x86/is_fpreg.c (100%) rename {src => libunwind/src}/x86/longjmp.S (100%) rename {src => libunwind/src}/x86/offsets.h (100%) rename {src => libunwind/src}/x86/regname.c (100%) rename {src => libunwind/src}/x86/siglongjmp.S (100%) rename {src => libunwind/src}/x86/unwind_i.h (97%) rename {src/x86 => libunwind/src/x86_64}/Gapply_reg_state.c (100%) rename {src => libunwind/src}/x86_64/Gcreate_addr_space.c (100%) rename {src => libunwind/src}/x86_64/Gget_proc_info.c (100%) rename {src => libunwind/src}/x86_64/Gget_save_loc.c (100%) rename {src => libunwind/src}/x86_64/Gglobal.c (100%) rename {src => libunwind/src}/x86_64/Ginit.c (93%) rename {src => libunwind/src}/x86_64/Ginit_local.c (78%) rename {src => libunwind/src}/x86_64/Ginit_remote.c (96%) rename {src => libunwind/src}/x86_64/Gos-freebsd.c (85%) rename {src => libunwind/src}/x86_64/Gos-linux.c (100%) rename {src => libunwind/src}/x86_64/Gos-solaris.c (98%) rename {src/x86 => libunwind/src/x86_64}/Greg_states_iterate.c (100%) rename {src => libunwind/src}/x86_64/Gregs.c (100%) rename {src => libunwind/src}/x86_64/Gresume.c (100%) rename {src => libunwind/src}/x86_64/Gstash_frame.c (100%) rename {src => libunwind/src}/x86_64/Gstep.c (97%) rename {src => libunwind/src}/x86_64/Gtrace.c (100%) rename {src/x86 => libunwind/src/x86_64}/Lapply_reg_state.c (100%) rename {src => libunwind/src}/x86_64/Lcreate_addr_space.c (100%) rename {src => libunwind/src}/x86_64/Lget_proc_info.c (100%) rename {src => libunwind/src}/x86_64/Lget_save_loc.c (100%) rename {src => libunwind/src}/x86_64/Lglobal.c (100%) rename {src => libunwind/src}/x86_64/Linit.c (100%) rename {src => libunwind/src}/x86_64/Linit_local.c (100%) rename {src => libunwind/src}/x86_64/Linit_remote.c (100%) rename {src => libunwind/src}/x86_64/Los-freebsd.c (100%) rename {src => libunwind/src}/x86_64/Los-linux.c (100%) rename {src => libunwind/src}/x86_64/Los-solaris.c (100%) rename {src/x86 => libunwind/src/x86_64}/Lreg_states_iterate.c (100%) rename {src => libunwind/src}/x86_64/Lregs.c (100%) rename {src => libunwind/src}/x86_64/Lresume.c (100%) rename {src => libunwind/src}/x86_64/Lstash_frame.c (100%) rename {src => libunwind/src}/x86_64/Lstep.c (100%) rename {src => libunwind/src}/x86_64/Ltrace.c (100%) rename {src => libunwind/src}/x86_64/getcontext.S (100%) rename {src => libunwind/src}/x86_64/init.h (100%) rename {src => libunwind/src}/x86_64/is_fpreg.c (100%) rename {src => libunwind/src}/x86_64/longjmp.S (100%) rename {src => libunwind/src}/x86_64/offsets.h (100%) rename {src => libunwind/src}/x86_64/regname.c (100%) rename {src => libunwind/src}/x86_64/setcontext.S (100%) rename {src => libunwind/src}/x86_64/siglongjmp.S (100%) rename {src => libunwind/src}/x86_64/ucontext_i.h (98%) rename {src => libunwind/src}/x86_64/unwind_i.h (97%) rename {tests => libunwind/tests}/Gia64-test-nat.c (100%) rename {tests => libunwind/tests}/Gia64-test-rbs.c (100%) rename {tests => libunwind/tests}/Gia64-test-readonly.c (100%) rename {tests => libunwind/tests}/Gia64-test-stack.c (100%) rename {tests => libunwind/tests}/Gperf-simple.c (100%) rename {tests => libunwind/tests}/Gperf-trace.c (100%) rename {tests => libunwind/tests}/Gtest-bt.c (100%) rename {tests => libunwind/tests}/Gtest-concurrent.c (100%) rename {tests => libunwind/tests}/Gtest-dyn1.c (100%) rename {tests => libunwind/tests}/Gtest-exc.c (100%) rename {tests => libunwind/tests}/Gtest-init.cxx (100%) rename {tests => libunwind/tests}/Gtest-nomalloc.c (100%) rename {tests => libunwind/tests}/Gtest-resume-sig-rt.c (100%) rename {tests => libunwind/tests}/Gtest-resume-sig.c (100%) rename {tests => libunwind/tests}/Gtest-trace.c (100%) rename {tests => libunwind/tests}/Gx64-test-dwarf-expressions.c (100%) rename {tests => libunwind/tests}/Lia64-test-nat.c (100%) rename {tests => libunwind/tests}/Lia64-test-rbs.c (100%) rename {tests => libunwind/tests}/Lia64-test-readonly.c (100%) rename {tests => libunwind/tests}/Lia64-test-stack.c (100%) rename {tests => libunwind/tests}/Lperf-simple.c (100%) rename {tests => libunwind/tests}/Lperf-trace.c (100%) rename {tests => libunwind/tests}/Lrs-race.c (100%) rename {tests => libunwind/tests}/Ltest-bt.c (100%) rename {tests => libunwind/tests}/Ltest-concurrent.c (100%) rename {tests => libunwind/tests}/Ltest-cxx-exceptions.cxx (100%) rename {tests => libunwind/tests}/Ltest-dyn1.c (100%) rename {tests => libunwind/tests}/Ltest-exc.c (100%) rename {tests => libunwind/tests}/Ltest-init-local-signal-lib.c (100%) rename {tests => libunwind/tests}/Ltest-init-local-signal.c (100%) rename {tests => libunwind/tests}/Ltest-init.cxx (100%) rename {tests => libunwind/tests}/Ltest-mem-validate.c (97%) rename {tests => libunwind/tests}/Ltest-nocalloc.c (100%) rename {tests => libunwind/tests}/Ltest-nomalloc.c (100%) rename {tests => libunwind/tests}/Ltest-resume-sig-rt.c (100%) rename {tests => libunwind/tests}/Ltest-resume-sig.c (100%) rename {tests => libunwind/tests}/Ltest-trace.c (100%) rename {tests => libunwind/tests}/Ltest-varargs.c (100%) rename {tests => libunwind/tests}/Lx64-test-dwarf-expressions.c (100%) rename {tests => libunwind/tests}/Makefile.am (100%) create mode 100644 libunwind/tests/check-namespace.sh rename {tests => libunwind/tests}/check-namespace.sh.in (92%) rename {tests => libunwind/tests}/crasher.c (100%) rename {tests => libunwind/tests}/flush-cache.S (100%) rename {tests => libunwind/tests}/flush-cache.h (100%) rename {tests => libunwind/tests}/forker.c (100%) rename {tests => libunwind/tests}/ia64-dyn-asm.S (100%) rename {tests => libunwind/tests}/ia64-test-dyn1.c (100%) rename {tests => libunwind/tests}/ia64-test-nat-asm.S (100%) rename {tests => libunwind/tests}/ia64-test-rbs-asm.S (100%) rename {tests => libunwind/tests}/ia64-test-rbs.h (100%) rename {tests => libunwind/tests}/ia64-test-readonly-asm.S (100%) rename {tests => libunwind/tests}/ia64-test-setjmp.c (100%) rename {tests => libunwind/tests}/ia64-test-sig.c (100%) rename {tests => libunwind/tests}/ia64-test-stack-asm.S (100%) rename {tests => libunwind/tests}/ia64-test-stack.h (100%) rename {tests => libunwind/tests}/ident.c (100%) rename {tests => libunwind/tests}/mapper.c (93%) rename {tests => libunwind/tests}/ppc64-test-altivec-utils.c (100%) rename {tests => libunwind/tests}/ppc64-test-altivec.c (100%) rename {tests => libunwind/tests}/run-check-namespace (100%) rename {tests => libunwind/tests}/run-coredump-unwind (94%) rename {tests => libunwind/tests}/run-coredump-unwind-mdi (100%) rename {tests => libunwind/tests}/run-ia64-test-dyn1 (100%) rename {tests => libunwind/tests}/run-ptrace-mapper (100%) rename {tests => libunwind/tests}/run-ptrace-misc (100%) rename {tests => libunwind/tests}/test-async-sig.c (100%) rename {tests => libunwind/tests}/test-coredump-unwind.c (100%) rename {tests => libunwind/tests}/test-flush-cache.c (100%) rename {tests => libunwind/tests}/test-init-remote.c (100%) rename {tests => libunwind/tests}/test-mem.c (100%) rename {tests => libunwind/tests}/test-proc-info.c (100%) rename {tests => libunwind/tests}/test-ptrace-misc.c (100%) rename {tests => libunwind/tests}/test-ptrace.c (97%) rename {tests => libunwind/tests}/test-reg-state.c (100%) rename {tests => libunwind/tests}/test-setjmp.c (100%) rename {tests => libunwind/tests}/test-static-link-gen.c (100%) rename {tests => libunwind/tests}/test-static-link-loc.c (100%) rename {tests => libunwind/tests}/test-strerror.c (100%) rename {tests => libunwind/tests}/x64-test-dwarf-expressions.S (100%) rename {tests => libunwind/tests}/x64-unwind-badjmp-signal-frame.c (100%) delete mode 100755 scripts/kernel-diff.sh delete mode 100644 scripts/kernel-files.txt delete mode 100755 scripts/make-L-files delete mode 100644 src/CMakeLists.txt delete mode 100644 src/aarch64/gen-offsets.c delete mode 100644 src/arm/gen-offsets.c delete mode 100644 src/coredump/README delete mode 100644 src/hppa/get_accessors.c delete mode 100644 src/hppa/tables.c delete mode 100644 src/ia64/NOTES delete mode 100644 src/mi/Ldyn-remote.c delete mode 100644 src/mi/maps.c delete mode 100755 src/mingw/pal-single-threaded.c delete mode 100644 src/mips/elfxx.c delete mode 100644 src/mips/gen-offsets.c delete mode 100644 src/ohos-config.c delete mode 100644 src/os-linux.c delete mode 100644 src/os-ohos.c delete mode 100644 src/os-ohos.h delete mode 100644 src/ppc32/Make-arch.in delete mode 100644 src/ppc32/setcontext.S delete mode 100644 src/ppc64/setcontext.S delete mode 100644 src/setjmp/setjmp.c delete mode 100644 src/setjmp/sigsetjmp.c delete mode 100644 src/sh/gen-offsets.c delete mode 100644 src/tilegx/Lis_signal_frame.c delete mode 100644 src/tilegx/elfxx.c delete mode 100644 src/tilegx/gen-offsets.c delete mode 100644 src/win/pal-single-threaded.c delete mode 100644 src/x86_64/Gapply_reg_state.c delete mode 100644 src/x86_64/Greg_states_iterate.c delete mode 100644 src/x86_64/Lapply_reg_state.c delete mode 100644 src/x86_64/Lreg_states_iterate.c delete mode 100644 tests/dummy_backtrace.c delete mode 100755 tests/perf-startup diff --git a/BUILD.gn b/BUILD.gn index 09f0f392..494c9292 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -17,259 +17,256 @@ if (defined(ohos_lite)) { import("//build/ohos.gni") } import("//third_party/libunwind/libunwind.gni") - common_source = [ - "src/dwarf/Gexpr.c", - "src/dwarf/Gfde.c", - "src/dwarf/Gfind_proc_info-lsb.c", - "src/dwarf/Gfind_unwind_table.c", - "src/dwarf/global.c", - "src/dwarf/Gparser.c", - "src/dwarf/Gpe.c", - "src/dwarf/Lexpr.c", - "src/dwarf/Lfde.c", - "src/dwarf/Lfind_proc_info-lsb.c", - "src/dwarf/Lfind_unwind_table.c", - "src/dwarf/Lparser.c", - "src/dwarf/Lpe.c", - "src/mi/backtrace.c", - "src/mi/dyn-cancel.c", - "src/mi/dyn-info-list.c", - "src/mi/dyn-register.c", - "src/mi/flush_cache.c", - "src/mi/Gdestroy_addr_space.c", - "src/mi/Gdyn-extract.c", - "src/mi/Gdyn-remote.c", - "src/mi/Gfind_dynamic_proc_info.c", - "src/mi/Gget_accessors.c", - "src/mi/Gget_fpreg.c", - "src/mi/Gget_proc_info_by_ip.c", - "src/mi/Gget_proc_name.c", - "src/mi/Gget_reg.c", - "src/mi/Gput_dynamic_unwind_info.c", - "src/mi/Gset_cache_size.c", - "src/mi/Gset_caching_policy.c", - "src/mi/Gset_fpreg.c", - "src/mi/Gset_reg.c", - "src/mi/init.c", - "src/mi/Ldestroy_addr_space.c", - "src/mi/Ldyn-extract.c", - "src/mi/Lfind_dynamic_proc_info.c", - "src/mi/Lget_fpreg.c", - "src/mi/Lget_proc_info_by_ip.c", - "src/mi/Lget_proc_name.c", - "src/mi/Lget_reg.c", - "src/mi/Lput_dynamic_unwind_info.c", - "src/mi/Lset_cache_size.c", - "src/mi/Lset_caching_policy.c", - "src/mi/Lset_fpreg.c", - "src/mi/Lset_reg.c", - "src/mi/mempool.c", - "src/mi/strerror.c", - "src/os-linux.c", - "src/ohos-config.c", - "src/ptrace/_UPT_access_fpreg.c", - "src/ptrace/_UPT_access_mem.c", - "src/ptrace/_UPT_access_reg.c", - "src/ptrace/_UPT_accessors.c", - "src/ptrace/_UPT_create.c", - "src/ptrace/_UPT_destroy.c", - "src/ptrace/_UPT_find_proc_info.c", - "src/ptrace/_UPT_get_dyn_info_list_addr.c", - "src/ptrace/_UPT_get_proc_name.c", - "src/ptrace/_UPT_put_unwind_info.c", - "src/ptrace/_UPT_reg_offset.c", - "src/ptrace/_UPT_resume.c", - "src/mi/maps.c", + "libunwind/src/dwarf/Gexpr.c", + "libunwind/src/dwarf/Gfde.c", + "libunwind/src/dwarf/Gfind_proc_info-lsb.c", + "libunwind/src/dwarf/Gfind_unwind_table.c", + "libunwind/src/dwarf/global.c", + "libunwind/src/dwarf/Gparser.c", + "libunwind/src/dwarf/Gpe.c", + "libunwind/src/dwarf/Lexpr.c", + "libunwind/src/dwarf/Lfde.c", + "libunwind/src/dwarf/Lfind_proc_info-lsb.c", + "libunwind/src/dwarf/Lfind_unwind_table.c", + "libunwind/src/dwarf/Lparser.c", + "libunwind/src/dwarf/Lpe.c", + "libunwind/src/mi/backtrace.c", + "libunwind/src/mi/dyn-cancel.c", + "libunwind/src/mi/dyn-info-list.c", + "libunwind/src/mi/dyn-register.c", + "libunwind/src/mi/flush_cache.c", + "libunwind/src/mi/Gdestroy_addr_space.c", + "libunwind/src/mi/Gdyn-extract.c", + "libunwind/src/mi/Gdyn-remote.c", + "libunwind/src/mi/Gfind_dynamic_proc_info.c", + "libunwind/src/mi/Gget_accessors.c", + "libunwind/src/mi/Gget_fpreg.c", + "libunwind/src/mi/Gget_proc_info_by_ip.c", + "libunwind/src/mi/Gget_proc_name.c", + "libunwind/src/mi/Gget_reg.c", + "libunwind/src/mi/Gput_dynamic_unwind_info.c", + "libunwind/src/mi/Gset_cache_size.c", + "libunwind/src/mi/Gset_caching_policy.c", + "libunwind/src/mi/Gset_fpreg.c", + "libunwind/src/mi/Gset_reg.c", + "libunwind/src/mi/init.c", + "libunwind/src/mi/Ldestroy_addr_space.c", + "libunwind/src/mi/Ldyn-extract.c", + "libunwind/src/mi/Lfind_dynamic_proc_info.c", + "libunwind/src/mi/Lget_fpreg.c", + "libunwind/src/mi/Lget_proc_info_by_ip.c", + "libunwind/src/mi/Lget_proc_name.c", + "libunwind/src/mi/Lget_reg.c", + "libunwind/src/mi/Lput_dynamic_unwind_info.c", + "libunwind/src/mi/Lset_cache_size.c", + "libunwind/src/mi/Lset_caching_policy.c", + "libunwind/src/mi/Lset_fpreg.c", + "libunwind/src/mi/Lset_reg.c", + "libunwind/src/mi/mempool.c", + "libunwind/src/mi/strerror.c", + "libunwind/src/os-linux.c", + "libunwind/src/ptrace/_UPT_access_fpreg.c", + "libunwind/src/ptrace/_UPT_access_mem.c", + "libunwind/src/ptrace/_UPT_access_reg.c", + "libunwind/src/ptrace/_UPT_accessors.c", + "libunwind/src/ptrace/_UPT_create.c", + "libunwind/src/ptrace/_UPT_destroy.c", + "libunwind/src/ptrace/_UPT_find_proc_info.c", + "libunwind/src/ptrace/_UPT_get_dyn_info_list_addr.c", + "libunwind/src/ptrace/_UPT_get_proc_name.c", + "libunwind/src/ptrace/_UPT_put_unwind_info.c", + "libunwind/src/ptrace/_UPT_reg_offset.c", + "libunwind/src/ptrace/_UPT_resume.c", ] # as libc++ is static linked with libunwind.a # we remove the Gstep.c for duplicated symbol violation arm_source = [ - "src/arm/Gapply_reg_state.c", - "src/arm/Gcreate_addr_space.c", - "src/arm/Gex_tables.c", - "src/arm/Gget_proc_info.c", - "src/arm/Gget_save_loc.c", - "src/arm/Gglobal.c", - "src/arm/Ginit.c", - "src/arm/Ginit_local.c", - "src/arm/Ginit_remote.c", - "src/arm/Gos-linux.c", - "src/arm/Greg_states_iterate.c", - "src/arm/Gregs.c", - "src/arm/Gresume.c", - "src/arm/Gstash_frame.c", - "src/arm/Gstep.c", - "src/arm/Gtrace.c", - "src/arm/Lcreate_addr_space.c", - "src/arm/Lex_tables.c", - "src/arm/Lget_proc_info.c", - "src/arm/Lget_save_loc.c", - "src/arm/Lglobal.c", - "src/arm/Linit.c", - "src/arm/Linit_local.c", - "src/arm/Linit_remote.c", - "src/arm/Los-linux.c", - "src/arm/Lregs.c", - "src/arm/Lresume.c", - "src/arm/Lstash_frame.c", - "src/arm/Lstep.c", - "src/arm/Ltrace.c", - "src/arm/getcontext.S", - "src/arm/is_fpreg.c", - "src/arm/regname.c", - "src/arm/siglongjmp.S", - "src/elf32.c", + "libunwind/src/arm/Gapply_reg_state.c", + "libunwind/src/arm/Gcreate_addr_space.c", + "libunwind/src/arm/Gex_tables.c", + "libunwind/src/arm/Gget_proc_info.c", + "libunwind/src/arm/Gget_save_loc.c", + "libunwind/src/arm/Gglobal.c", + "libunwind/src/arm/Ginit.c", + "libunwind/src/arm/Ginit_local.c", + "libunwind/src/arm/Ginit_remote.c", + "libunwind/src/arm/Gos-linux.c", + "libunwind/src/arm/Greg_states_iterate.c", + "libunwind/src/arm/Gregs.c", + "libunwind/src/arm/Gresume.c", + "libunwind/src/arm/Gstash_frame.c", + "libunwind/src/arm/Gstep.c", + "libunwind/src/arm/Gtrace.c", + "libunwind/src/arm/Lcreate_addr_space.c", + "libunwind/src/arm/Lex_tables.c", + "libunwind/src/arm/Lget_proc_info.c", + "libunwind/src/arm/Lget_save_loc.c", + "libunwind/src/arm/Lglobal.c", + "libunwind/src/arm/Linit.c", + "libunwind/src/arm/Linit_local.c", + "libunwind/src/arm/Linit_remote.c", + "libunwind/src/arm/Los-linux.c", + "libunwind/src/arm/Lregs.c", + "libunwind/src/arm/Lresume.c", + "libunwind/src/arm/Lstash_frame.c", + "libunwind/src/arm/Lstep.c", + "libunwind/src/arm/Ltrace.c", + "libunwind/src/arm/getcontext.S", + "libunwind/src/arm/is_fpreg.c", + "libunwind/src/arm/regname.c", + "libunwind/src/arm/siglongjmp.S", + "libunwind/src/elf32.c", ] arm64_source = [ - "src/aarch64/Gcreate_addr_space.c", - "src/aarch64/Gget_proc_info.c", - "src/aarch64/Gget_save_loc.c", - "src/aarch64/Gglobal.c", - "src/aarch64/Ginit.c", - "src/aarch64/Ginit_local.c", - "src/aarch64/Ginit_remote.c", - "src/aarch64/Gis_signal_frame.c", - "src/aarch64/Gregs.c", - "src/aarch64/Gresume.c", - "src/aarch64/Gstash_frame.c", - "src/aarch64/Gstep.c", - "src/aarch64/Gtrace.c", - "src/aarch64/Lcreate_addr_space.c", - "src/aarch64/Lget_proc_info.c", - "src/aarch64/Lget_save_loc.c", - "src/aarch64/Lglobal.c", - "src/aarch64/Linit.c", - "src/aarch64/Linit_local.c", - "src/aarch64/Linit_remote.c", - "src/aarch64/Lis_signal_frame.c", - "src/aarch64/Lregs.c", - "src/aarch64/Lresume.c", - "src/aarch64/Lstash_frame.c", - "src/aarch64/Lstep.c", - "src/aarch64/Ltrace.c", - "src/aarch64/getcontext.S", - "src/aarch64/is_fpreg.c", - "src/aarch64/regname.c", - "src/elf64.c", + "libunwind/src/aarch64/Gcreate_addr_space.c", + "libunwind/src/aarch64/Gget_proc_info.c", + "libunwind/src/aarch64/Gget_save_loc.c", + "libunwind/src/aarch64/Gglobal.c", + "libunwind/src/aarch64/Ginit.c", + "libunwind/src/aarch64/Ginit_local.c", + "libunwind/src/aarch64/Ginit_remote.c", + "libunwind/src/aarch64/Gis_signal_frame.c", + "libunwind/src/aarch64/Gregs.c", + "libunwind/src/aarch64/Gresume.c", + "libunwind/src/aarch64/Gstash_frame.c", + "libunwind/src/aarch64/Gstep.c", + "libunwind/src/aarch64/Gtrace.c", + "libunwind/src/aarch64/Lcreate_addr_space.c", + "libunwind/src/aarch64/Lget_proc_info.c", + "libunwind/src/aarch64/Lget_save_loc.c", + "libunwind/src/aarch64/Lglobal.c", + "libunwind/src/aarch64/Linit.c", + "libunwind/src/aarch64/Linit_local.c", + "libunwind/src/aarch64/Linit_remote.c", + "libunwind/src/aarch64/Lis_signal_frame.c", + "libunwind/src/aarch64/Lregs.c", + "libunwind/src/aarch64/Lresume.c", + "libunwind/src/aarch64/Lstash_frame.c", + "libunwind/src/aarch64/Lstep.c", + "libunwind/src/aarch64/Ltrace.c", + "libunwind/src/aarch64/getcontext.S", + "libunwind/src/aarch64/is_fpreg.c", + "libunwind/src/aarch64/regname.c", + "libunwind/src/elf64.c", ] x64_source = [ - "src/elf64.c", - "src/x86_64/Gcreate_addr_space.c", - "src/x86_64/Gget_proc_info.c", - "src/x86_64/Gget_save_loc.c", - "src/x86_64/Gglobal.c", - "src/x86_64/Ginit.c", - "src/x86_64/Ginit_local.c", - "src/x86_64/Ginit_remote.c", - "src/x86_64/Gos-linux.c", - "src/x86_64/Gregs.c", - "src/x86_64/Gresume.c", - "src/x86_64/Gstash_frame.c", - "src/x86_64/Gstep.c", - "src/x86_64/Gtrace.c", - "src/x86_64/Lcreate_addr_space.c", - "src/x86_64/Lget_proc_info.c", - "src/x86_64/Lget_save_loc.c", - "src/x86_64/Lglobal.c", - "src/x86_64/Linit.c", - "src/x86_64/Linit_local.c", - "src/x86_64/Linit_remote.c", - "src/x86_64/Los-linux.c", - "src/x86_64/Lregs.c", - "src/x86_64/Lresume.c", - "src/x86_64/Lstash_frame.c", - "src/x86_64/Lstep.c", - "src/x86_64/Ltrace.c", - "src/x86_64/getcontext.S", - "src/x86_64/is_fpreg.c", - "src/x86_64/regname.c", - "src/x86_64/setcontext.S", + "libunwind/src/elf64.c", + "libunwind/src/x86_64/Gcreate_addr_space.c", + "libunwind/src/x86_64/Gget_proc_info.c", + "libunwind/src/x86_64/Gget_save_loc.c", + "libunwind/src/x86_64/Gglobal.c", + "libunwind/src/x86_64/Ginit.c", + "libunwind/src/x86_64/Ginit_local.c", + "libunwind/src/x86_64/Ginit_remote.c", + "libunwind/src/x86_64/Gos-linux.c", + "libunwind/src/x86_64/Gregs.c", + "libunwind/src/x86_64/Gresume.c", + "libunwind/src/x86_64/Gstash_frame.c", + "libunwind/src/x86_64/Gstep.c", + "libunwind/src/x86_64/Gtrace.c", + "libunwind/src/x86_64/Lcreate_addr_space.c", + "libunwind/src/x86_64/Lget_proc_info.c", + "libunwind/src/x86_64/Lget_save_loc.c", + "libunwind/src/x86_64/Lglobal.c", + "libunwind/src/x86_64/Linit.c", + "libunwind/src/x86_64/Linit_local.c", + "libunwind/src/x86_64/Linit_remote.c", + "libunwind/src/x86_64/Los-linux.c", + "libunwind/src/x86_64/Lregs.c", + "libunwind/src/x86_64/Lresume.c", + "libunwind/src/x86_64/Lstash_frame.c", + "libunwind/src/x86_64/Lstep.c", + "libunwind/src/x86_64/Ltrace.c", + "libunwind/src/x86_64/getcontext.S", + "libunwind/src/x86_64/is_fpreg.c", + "libunwind/src/x86_64/regname.c", + "libunwind/src/x86_64/setcontext.S", ] riscv64_source = [ - "src/elf64.c", - "src/riscv/Gapply_reg_state.c", - "src/riscv/Gcreate_addr_space.c", - "src/riscv/getcontext.S", - "src/riscv/Gget_proc_info.c", - "src/riscv/Gget_save_loc.c", - "src/riscv/Gglobal.c", - "src/riscv/Ginit.c", - "src/riscv/Ginit_local.c", - "src/riscv/Ginit_remote.c", - "src/riscv/Gis_signal_frame.c", - "src/riscv/Gregs.c", - "src/riscv/Greg_states_iterate.c", - "src/riscv/Gresume.c", - "src/riscv/Gstep.c", - "src/riscv/is_fpreg.c", - "src/riscv/Lcreate_addr_space.c", - "src/riscv/Lget_proc_info.c", - "src/riscv/Lget_save_loc.c", - "src/riscv/Lglobal.c", - "src/riscv/Linit.c", - "src/riscv/Linit_local.c", - "src/riscv/Linit_remote.c", - "src/riscv/Lis_signal_frame.c", - "src/riscv/Lregs.c", - "src/riscv/Lreg_states_iterate.c", - "src/riscv/Lresume.c", - "src/riscv/Lstep.c", - "src/riscv/offsets.h", - "src/riscv/regname.c", - "src/riscv/setcontext.S", - "src/riscv/siglongjmp.S", + "libunwind/src/elf64.c", + "libunwind/src/riscv/Gapply_reg_state.c", + "libunwind/src/riscv/Gcreate_addr_space.c", + "libunwind/src/riscv/getcontext.S", + "libunwind/src/riscv/Gget_proc_info.c", + "libunwind/src/riscv/Gget_save_loc.c", + "libunwind/src/riscv/Gglobal.c", + "libunwind/src/riscv/Ginit.c", + "libunwind/src/riscv/Ginit_local.c", + "libunwind/src/riscv/Ginit_remote.c", + "libunwind/src/riscv/Gis_signal_frame.c", + "libunwind/src/riscv/Gregs.c", + "libunwind/src/riscv/Greg_states_iterate.c", + "libunwind/src/riscv/Gresume.c", + "libunwind/src/riscv/Gstep.c", + "libunwind/src/riscv/is_fpreg.c", + "libunwind/src/riscv/Lcreate_addr_space.c", + "libunwind/src/riscv/Lget_proc_info.c", + "libunwind/src/riscv/Lget_save_loc.c", + "libunwind/src/riscv/Lglobal.c", + "libunwind/src/riscv/Linit.c", + "libunwind/src/riscv/Linit_local.c", + "libunwind/src/riscv/Linit_remote.c", + "libunwind/src/riscv/Lis_signal_frame.c", + "libunwind/src/riscv/Lregs.c", + "libunwind/src/riscv/Lreg_states_iterate.c", + "libunwind/src/riscv/Lresume.c", + "libunwind/src/riscv/Lstep.c", + "libunwind/src/riscv/offsets.h", + "libunwind/src/riscv/regname.c", + "libunwind/src/riscv/setcontext.S", + "libunwind/src/riscv/siglongjmp.S", ] remove_sources = [] ptrace_sources = [ - "src/ptrace/_UPT_access_fpreg.c", - "src/ptrace/_UPT_access_mem.c", - "src/ptrace/_UPT_access_reg.c", - "src/ptrace/_UPT_accessors.c", - "src/ptrace/_UPT_create.c", - "src/ptrace/_UPT_destroy.c", - "src/ptrace/_UPT_find_proc_info.c", - "src/ptrace/_UPT_get_dyn_info_list_addr.c", - "src/ptrace/_UPT_get_proc_name.c", - "src/ptrace/_UPT_put_unwind_info.c", - "src/ptrace/_UPT_reg_offset.c", - "src/ptrace/_UPT_resume.c", + "libunwind/src/ptrace/_UPT_access_fpreg.c", + "libunwind/src/ptrace/_UPT_access_mem.c", + "libunwind/src/ptrace/_UPT_access_reg.c", + "libunwind/src/ptrace/_UPT_accessors.c", + "libunwind/src/ptrace/_UPT_create.c", + "libunwind/src/ptrace/_UPT_destroy.c", + "libunwind/src/ptrace/_UPT_find_proc_info.c", + "libunwind/src/ptrace/_UPT_get_dyn_info_list_addr.c", + "libunwind/src/ptrace/_UPT_get_proc_name.c", + "libunwind/src/ptrace/_UPT_put_unwind_info.c", + "libunwind/src/ptrace/_UPT_reg_offset.c", + "libunwind/src/ptrace/_UPT_resume.c", ] libunwind_la_SOURCES_local_nounwind = [ - "src/mi/backtrace.c", - "src/mi/dyn-cancel.c", - "src/mi/dyn-info-list.c", - "src/mi/dyn-register.c", - "src/mi/Ldyn-extract.c", - "src/mi/Lfind_dynamic_proc_info.c", + "libunwind/src/mi/backtrace.c", + "libunwind/src/mi/dyn-cancel.c", + "libunwind/src/mi/dyn-info-list.c", + "libunwind/src/mi/dyn-register.c", + "libunwind/src/mi/Ldyn-extract.c", + "libunwind/src/mi/Lfind_dynamic_proc_info.c", - # "src/mi/Lget_accessors.c", # miss - "src/mi/Lget_proc_info_by_ip.c", - "src/mi/Lget_proc_name.c", - "src/mi/Lput_dynamic_unwind_info.c", - "src/mi/Ldestroy_addr_space.c", - "src/mi/Lget_reg.c", - "src/mi/Lset_reg.c", - "src/mi/Lget_fpreg.c", - "src/mi/Lset_fpreg.c", - "src/mi/Lset_caching_policy.c", - "src/mi/Lset_cache_size.c", + # "libunwind/src/mi/Lget_accessors.c", # miss + "libunwind/src/mi/Lget_proc_info_by_ip.c", + "libunwind/src/mi/Lget_proc_name.c", + "libunwind/src/mi/Lput_dynamic_unwind_info.c", + "libunwind/src/mi/Ldestroy_addr_space.c", + "libunwind/src/mi/Lget_reg.c", + "libunwind/src/mi/Lset_reg.c", + "libunwind/src/mi/Lget_fpreg.c", + "libunwind/src/mi/Lset_fpreg.c", + "libunwind/src/mi/Lset_caching_policy.c", + "libunwind/src/mi/Lset_cache_size.c", ] libunwind_dwarf_local_la_SOURCES = [ - "src/dwarf/Lexpr.c", - "src/dwarf/Lfde.c", - "src/dwarf/Lparser.c", - "src/dwarf/Lpe.c", - "src/dwarf/Lfind_proc_info-lsb.c", - "src/dwarf/Lfind_unwind_table.c", + "libunwind/src/dwarf/Lexpr.c", + "libunwind/src/dwarf/Lfde.c", + "libunwind/src/dwarf/Lparser.c", + "libunwind/src/dwarf/Lpe.c", + "libunwind/src/dwarf/Lfind_proc_info-lsb.c", + "libunwind/src/dwarf/Lfind_unwind_table.c", ] # remove local file @@ -278,13 +275,13 @@ remove_sources += libunwind_dwarf_local_la_SOURCES remove_sources += ptrace_sources if (is_mingw) { - common_source += [ "src/mingw/pal-single-threaded.c" ] + common_source += [ "libunwind/src/mingw/pal-single-threaded.c" ] } config("unwind_config_public") { include_dirs = [ - "src", - "include", + "libunwind/src", + "libunwind/include", ] cflags = [ @@ -293,13 +290,13 @@ config("unwind_config_public") { "-DNDEBUG", "-DCC_IS_CLANG", "-fcommon", - "-Werror", "-Wno-absolute-value", "-Wno-header-guard", "-Wno-unused-parameter", "-Wno-unused-variable", "-Wno-int-to-pointer-cast", "-Wno-pointer-to-int-cast", + "-Wno-error", ] if (defined(ohos_lite)) { @@ -307,7 +304,7 @@ config("unwind_config_public") { } if (target_cpu == "arm") { - include_dirs += [ "include/tdep-arm" ] + include_dirs += [ "libunwind/include/tdep-arm" ] cflags += [ "-Wno-inline-asm", "-Wno-shift-count-overflow", @@ -315,15 +312,15 @@ config("unwind_config_public") { "-Wno-unused-function", ] } else if (target_cpu == "riscv64") { - include_dirs += [ "include/tdep-riscv" ] + include_dirs += [ "libunwind/include/tdep-riscv" ] cflags += [ "-Wno-implicit-function-declaration" ] } else if (target_cpu == "arm64") { - include_dirs += [ "include/tdep-aarch64" ] + include_dirs += [ "libunwind/include/tdep-aarch64" ] cflags += [ "-Wno-incompatible-pointer-types" ] } else if (target_cpu == "x64" || target_cpu == "x86_64") { - include_dirs += [ "include/tdep-x86_64" ] + include_dirs += [ "libunwind/include/tdep-x86_64" ] } else if (target_cpu == "mipsel") { - include_dirs += [ "include/tdep-mips" ] + include_dirs += [ "libunwind/include/tdep-mips" ] } } @@ -354,7 +351,7 @@ config("unwind_config_remote_public") { cflags += [ "-Wno-int-to-void-pointer-cast" ] if (is_mingw) { - include_dirs += [ "include/mingw" ] + include_dirs += [ "libunwind/include/mingw" ] cflags += [ "-DMINGW" ] } else if (is_linux) { cflags += [ "-g" ] # we need debug info when it crash. @@ -405,8 +402,8 @@ if (defined(ohos_lite)) { # no jump lib arm_source -= [ - "src/arm/getcontext.S", - "src/arm/siglongjmp.S", + "libunwind/src/arm/getcontext.S", + "libunwind/src/arm/siglongjmp.S", ] sources += arm_source sources -= remove_sources @@ -421,7 +418,7 @@ if (defined(ohos_lite)) { ] sources = common_source - arm64_source -= [ "src/aarch64/getcontext.S" ] + arm64_source -= [ "libunwind/src/aarch64/getcontext.S" ] sources += arm64_source sources -= remove_sources @@ -438,8 +435,8 @@ if (defined(ohos_lite)) { # no jump lib x64_source -= [ - "src/x86_64/getcontext.S", - "src/x86_64/setcontext.S", + "libunwind/src/x86_64/getcontext.S", + "libunwind/src/x86_64/setcontext.S", ] sources += x64_source sources -= remove_sources @@ -456,8 +453,8 @@ if (defined(ohos_lite)) { # no jump lib riscv64_source -= [ - "src/riscv/getcontext.S", - "src/riscv/setcontext.S", + "libunwind/src/riscv/getcontext.S", + "libunwind/src/riscv/setcontext.S", ] sources += riscv64_source @@ -471,8 +468,8 @@ if (defined(ohos_lite)) { if (target_cpu == "arm") { # no jump lib arm_source -= [ - "src/arm/getcontext.S", - "src/arm/siglongjmp.S", + "libunwind/src/arm/getcontext.S", + "libunwind/src/arm/siglongjmp.S", ] # as libc++ is static linked with libunwind.a @@ -492,8 +489,6 @@ if (defined(ohos_lite)) { sources += x64_source public_configs = [ ":unwind_config_x86_64" ] } - - sources += [ "src/os-ohos.c" ] } shared_library("libunwind") { @@ -528,7 +523,6 @@ if (defined(ohos_lite)) { public_configs += [ ":unwind_config_x86_64" ] } - sources += [ "src/os-ohos.c" ] sources -= libunwind_dwarf_local_la_SOURCES sources -= libunwind_la_SOURCES_local sources -= ptrace_sources @@ -552,8 +546,8 @@ if (defined(ohos_lite)) { # no jump lib arm_source -= [ - "src/arm/getcontext.S", - "src/arm/siglongjmp.S", + "libunwind/src/arm/getcontext.S", + "libunwind/src/arm/siglongjmp.S", ] sources += arm_source sources -= remove_sources @@ -568,7 +562,7 @@ if (defined(ohos_lite)) { ] sources = common_source - arm64_source -= [ "src/aarch64/getcontext.S" ] + arm64_source -= [ "libunwind/src/aarch64/getcontext.S" ] sources += arm64_source sources -= remove_sources @@ -584,7 +578,7 @@ if (defined(ohos_lite)) { ] sources = common_source - arm64_source -= [ "src/aarch64/getcontext.S" ] + arm64_source -= [ "libunwind/src/aarch64/getcontext.S" ] sources += arm64_source sources -= remove_sources @@ -601,8 +595,8 @@ if (defined(ohos_lite)) { # no jump lib x64_source -= [ - "src/x86_64/getcontext.S", - "src/x86_64/setcontext.S", + "libunwind/src/x86_64/getcontext.S", + "libunwind/src/x86_64/setcontext.S", ] sources += x64_source sources -= remove_sources @@ -619,8 +613,8 @@ if (defined(ohos_lite)) { # no jump lib x64_source -= [ - "src/x86_64/getcontext.S", - "src/x86_64/setcontext.S", + "libunwind/src/x86_64/getcontext.S", + "libunwind/src/x86_64/setcontext.S", ] sources += x64_source sources -= remove_sources @@ -637,8 +631,8 @@ if (defined(ohos_lite)) { # no jump lib riscv64_source -= [ - "src/riscv/getcontext.S", - "src/riscv/setcontext.S", + "libunwind/src/riscv/getcontext.S", + "libunwind/src/riscv/setcontext.S", ] sources += riscv64_source @@ -668,7 +662,6 @@ if (defined(ohos_lite)) { public_configs = [ ":unwind_config_x86_64" ] } - sources += [ "src/os-ohos.c" ] cflags = [ "-DHAS_ARK_FRAME", "-DPARSE_BUILD_ID", @@ -719,7 +712,6 @@ if (defined(ohos_lite)) { public_configs += [ ":unwind_config_x86_64" ] } - sources += [ "src/os-ohos.c" ] sources -= libunwind_dwarf_local_la_SOURCES sources -= libunwind_la_SOURCES_local sources -= ptrace_sources @@ -766,10 +758,10 @@ if (!defined(ohos_lite)) { ohos_unittest("Gtest_init") { module_out_path = module_output_path - sources = [ "tests/Gtest-init.cxx" ] + sources = [ "libunwind/test/Gtest-init.cxx" ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] @@ -780,10 +772,10 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_init") { module_out_path = module_output_path - sources = [ "tests/Ltest-init.cxx" ] + sources = [ "libunwind/test/Ltest-init.cxx" ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -793,10 +785,10 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_cxx_exceptions") { module_out_path = module_output_path - sources = [ "tests/Ltest-cxx-exceptions.cxx" ] + sources = [ "libunwind/test/Ltest-cxx-exceptions.cxx" ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] cflags = [ "-fexceptions" ] @@ -809,12 +801,12 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_init_local_signal") { module_out_path = module_output_path sources = [ - "tests/Ltest-init-local-signal-lib.c", - "tests/Ltest-init-local-signal.c", + "libunwind/test/Ltest-init-local-signal-lib.c", + "libunwind/test/Ltest-init-local-signal.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -825,15 +817,15 @@ if (!defined(ohos_lite)) { ohos_unittest("Gtest_dyn1") { module_out_path = module_output_path sources = [ - "tests/Gtest-dyn1.c", - "tests/flush-cache.h", + "libunwind/test/Gtest-dyn1.c", + "libunwind/test/flush-cache.h", ] if (target_cpu == "arm") { - sources += [ "tests/flush-cache.S" ] + sources += [ "libunwind/test/flush-cache.S" ] } include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] cflags = [ "-DHAVE__BUILTIN___CLEAR_CACHE" ] @@ -845,15 +837,15 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_dyn1") { module_out_path = module_output_path sources = [ - "tests/Ltest-dyn1.c", - "tests/flush-cache.h", + "libunwind/test/Ltest-dyn1.c", + "libunwind/test/flush-cache.h", ] if (target_cpu == "arm") { - sources += [ "tests/flush-cache.S" ] + sources += [ "libunwind/test/flush-cache.S" ] } include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] cflags = [ "-DHAVE__BUILTIN___CLEAR_CACHE" ] @@ -865,12 +857,12 @@ if (!defined(ohos_lite)) { ohos_unittest("test_static_link") { module_out_path = module_output_path sources = [ - "tests/test-static-link-gen.c", - "tests/test-static-link-loc.c", + "libunwind/test/test-static-link-gen.c", + "libunwind/test/test-static-link-loc.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -881,13 +873,13 @@ if (!defined(ohos_lite)) { ohos_unittest("Gtest_bt") { module_out_path = module_output_path sources = [ - "tests/Gtest-bt.c", - "tests/dummy_backtrace.c", - "tests/ident.c", + "libunwind/test/Gtest-bt.c", + "libunwind/test/dummy_backtrace.c", + "libunwind/test/ident.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -898,13 +890,13 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_bt") { module_out_path = module_output_path sources = [ - "tests/Ltest-bt.c", - "tests/dummy_backtrace.c", - "tests/ident.c", + "libunwind/test/Ltest-bt.c", + "libunwind/test/dummy_backtrace.c", + "libunwind/test/ident.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -915,12 +907,12 @@ if (!defined(ohos_lite)) { ohos_unittest("test_ptrace_misc") { module_out_path = module_output_path sources = [ - "tests/ident.c", - "tests/test-ptrace-misc.c", + "libunwind/test/ident.c", + "libunwind/test/test-ptrace-misc.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -930,10 +922,10 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_nomalloc") { module_out_path = module_output_path - sources = [ "tests/Ltest-nomalloc.c" ] + sources = [ "libunwind/test/Ltest-nomalloc.c" ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -943,10 +935,10 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_nocalloc") { module_out_path = module_output_path - sources = [ "tests/Ltest-nocalloc.c" ] + sources = [ "libunwind/test/Ltest-nocalloc.c" ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -957,13 +949,13 @@ if (!defined(ohos_lite)) { ohos_unittest("Gtest_trace") { module_out_path = module_output_path sources = [ - "tests/Gtest-trace.c", - "tests/dummy_backtrace.c", - "tests/ident.c", + "libunwind/test/Gtest-trace.c", + "libunwind/test/dummy_backtrace.c", + "libunwind/test/ident.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -974,13 +966,13 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_trace") { module_out_path = module_output_path sources = [ - "tests/Ltest-trace.c", - "tests/dummy_backtrace.c", - "tests/ident.c", + "libunwind/test/Ltest-trace.c", + "libunwind/test/dummy_backtrace.c", + "libunwind/test/ident.c", ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] @@ -990,10 +982,10 @@ if (!defined(ohos_lite)) { ohos_unittest("Ltest_mem_validate") { module_out_path = module_output_path - sources = [ "tests/Ltest-mem-validate.c" ] + sources = [ "libunwind/test/Ltest-mem-validate.c" ] include_dirs = [ - "tests", - "include", + "libunwind/test", + "libunwind/include", ] configs = [ ":unwind_test" ] deps = [ ":libunwind" ] diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 0b36d58d..00000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -project(libunwind) - -cmake_minimum_required(VERSION 3.16.1) - -set(PKG_MAJOR "1") -set(PKG_MINOR "6") -set(PKG_EXTRA "-rc1") -set(PACKAGE_STRING "libunwind") -set(PACKAGE_BUGREPORT "") - - -if ('$ENV{TARGET}' STREQUAL 'x86_64-linux-gnu') - set(TARGET_AMD64 1) - set(arch x86_64) - add_definitions(-D__x86_64__) - add_definitions(-D__amd64__) - add_definitions(-D__linux__) -elseif ('$ENV{TARGET}' STREQUAL 'aarch64-linux-gnu') - set(TARGET_AARCH64 1) - set(arch aarch64) - add_definitions(-D__aarch64__) - add_definitions(-D__linux__) -elseif ('$ENV{TARGET}' STREQUAL 'arm-linux-gnueabihf') - set(TARGET_ARM 1) - set(arch arm) - add_definitions(-D__arm__) - add_definitions(-D__linux__) -elseif ('$ENV{TARGET}' STREQUAL 's390x-linux-gnu') - set(TARGET_S390X 1) - set(arch s390x) - add_definitions(-D__s390x__) - add_definitions(-D__linux__) -else () - message(FATAL_ERROR "Unrecognize value in environment variable TARGET") -endif () - -include(CheckCSourceCompiles) -include(CheckIncludeFiles) - -if ("${CMAKE_GENERATOR}" MATCHES "^Visual Studio.*$") - message(VERBOSE "Using generator ${CMAKE_GENERATOR}") - # Assume we are using default MSVC compiler - add_compile_options(/std:c++latest) - add_compile_options(/TC) # compile all files as C - add_compile_options(/permissive-) - - # files for cross os compilation - include_directories(include/win) - - # Warnings in release builds - add_compile_options(-wd4068) # ignore unknown pragma warnings (gcc pragmas) - add_compile_options(-wd4146) # minus operator applied to unsigned - add_compile_options(-wd4244) # possible loss of data - add_compile_options(-wd4267) # possible loss of data - add_compile_options(-wd4334) # 32-bit shift implicitly converted to 64 bits - - # Disable warning due to incorrect format specifier in debugging printf via the Debug macro - add_compile_options(-wd4311) # pointer truncation from 'unw_word_t *' to 'long' - add_compile_options(-wd4475) # 'fprintf' : length modifier 'L' cannot be used - add_compile_options(-wd4477) # fprintf argument type - - # Windows builds will only support remote unwind - add_definitions(-DUNW_REMOTE_ONLY) - - # Disable security warnings - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - - # Our posix abstraction layer will provide these headers - set(HAVE_ELF_H 1) - set(HAVE_ENDIAN_H 1) - - # MSVC compiler is currently missing C11 stdalign.h header - # Fake it until support is added - check_include_files(stdalign.h HAVE_STDALIGN_H) - if (NOT HAVE_STDALIGN_H) - configure_file(include/win/fakestdalign.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/stdalign.h) - endif (NOT HAVE_STDALIGN_H) - - # MSVC compiler is currently missing C11 stdatomic.h header - # Fake it until support is added - check_include_files(stdatomic.h HAVE_STDATOMIC_H) - if (NOT HAVE_STDATOMIC_H) - configure_file(include/win/fakestdatomic.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/stdatomic.h) - endif (NOT HAVE_STDATOMIC_H) - - # MSVC compiler is currently missing C11 _Thread_local - check_c_source_compiles("void main() { _Thread_local int a; }" HAVE_THREAD_LOCAL) - if (NOT HAVE_THREAD_LOCAL) - add_definitions(-D_Thread_local=) - endif (NOT HAVE_THREAD_LOCAL) -else () - message(FATAL_ERROR "This CMake file is currently only designed for building on Visual Studio") -endif () - -add_definitions(-DHAVE_CONFIG_H) - -configure_file(include/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h) -configure_file(include/libunwind-common.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/libunwind-common.h) -configure_file(include/libunwind.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/libunwind.h) -configure_file(include/tdep/libunwind_i.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/tdep/libunwind_i.h) - -add_subdirectory(src) - diff --git a/NOTICE b/NOTICE deleted file mode 120000 index 7a694c96..00000000 --- a/NOTICE +++ /dev/null @@ -1 +0,0 @@ -LICENSE \ No newline at end of file diff --git a/README.OpenSource b/README.OpenSource index 250cf096..95947b0a 100644 --- a/README.OpenSource +++ b/README.OpenSource @@ -5,7 +5,7 @@ "License File": "LICENSE", "Version Number": "1.6.2", "Owner": "yanmengzhao1@huawei.com", - "Upstream URL": "http://www.nongnu.org/libunwind/", + "Upstream URL": "http://www.openeuler.org", "Description": "a portable and efficient C programming interface (API) to determine the call-chain of a program." } ] diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index b08bc831..00000000 --- a/autogen.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. -( - cd "$srcdir" && - autoreconf --force -v --install -) || exit -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/debug.log b/debug.log new file mode 100644 index 00000000..e69de29b diff --git a/include/config.h.cmake.in b/include/config.h.cmake.in deleted file mode 100644 index fc312ddb..00000000 --- a/include/config.h.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#cmakedefine01 HAVE_ELF_H -#cmakedefine01 HAVE_ENDIAN_H - -#define PACKAGE_STRING "@PACKAGE_STRING@" -#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" - -#endif // CONFIG_H diff --git a/include/libunwind-common.h b/include/libunwind-common.h deleted file mode 100644 index 4f32a3db..00000000 --- a/include/libunwind-common.h +++ /dev/null @@ -1,318 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2001-2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -/* Add For Cache MAP And ELF */ -#include -/* Add For Cache MAP And ELF */ - -#define UNW_VERSION_MAJOR 1 -#define UNW_VERSION_MINOR 3.1 -#define UNW_VERSION_EXTRA - -#define UNW_VERSION_CODE(maj, min) (((maj) << 16) | (min)) -#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR) - -#define UNW_PASTE2(x, y) x##y -#define UNW_PASTE(x, y) UNW_PASTE2(x, y) -#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn) -#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U, UNW_TARGET), _), fn) - -#ifdef UNW_LOCAL_ONLY -#define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL, UNW_TARGET), _) -#else /* !UNW_LOCAL_ONLY */ -#define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U, UNW_TARGET), _) -#endif /* !UNW_LOCAL_ONLY */ - -/* Error codes. The unwind routines return the *negated* values of - these error codes on error and a non-negative value on success. */ -typedef enum -{ - UNW_ESUCCESS = 0, /* no error */ - UNW_EUNSPEC, /* unspecified (general) error */ - UNW_ENOMEM, /* out of memory */ - UNW_EBADREG, /* bad register number */ - UNW_EREADONLYREG, /* attempt to write read-only register */ - UNW_ESTOPUNWIND, /* stop unwinding */ - UNW_EINVALIDIP, /* invalid IP */ - UNW_EBADFRAME, /* bad frame */ - UNW_EINVAL, /* unsupported operation or bad value */ - UNW_EBADVERSION, /* unwind info has unsupported version */ - UNW_ENOINFO /* no unwind info found */ -} unw_error_t; - -/* The following enum defines the indices for a couple of - (pseudo-)registers which have the same meaning across all - platforms. (RO) means read-only. (RW) means read-write. General - registers (aka "integer registers") are expected to start with - index 0. The number of such registers is architecture-dependent. - The remaining indices can be used as an architecture sees fit. The - last valid register index is given by UNW_REG_LAST. */ -typedef enum -{ - UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */ - UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */ - UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */ - UNW_REG_LAST = UNW_TDEP_LAST_REG -} unw_frame_regnum_t; - -/* Number of exception-handler argument registers: */ -#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS - -typedef enum -{ - UNW_CACHE_NONE, /* no caching */ - UNW_CACHE_GLOBAL, /* shared global cache */ - UNW_CACHE_PER_THREAD /* per-thread caching */ -} unw_caching_policy_t; - -typedef enum -{ - UNW_INIT_SIGNAL_FRAME = 1, /* We know this is a signal frame */ -} unw_init_local2_flags_t; - -typedef int unw_regnum_t; - -/* The unwind cursor starts at the youngest (most deeply nested) frame - and is used to track the frame state as the unwinder steps from - frame to frame. It is safe to make (shallow) copies of variables - of this type. */ -typedef struct unw_cursor -{ - unw_word_t opaque[UNW_TDEP_CURSOR_LEN]; -} unw_cursor_t; - -/* This type encapsulates the entire (preserved) machine-state. */ -typedef unw_tdep_context_t unw_context_t; - -/* unw_getcontext() fills the unw_context_t pointed to by UC with the - machine state as it exists at the call-site. For implementation - reasons, this needs to be a target-dependent macro. It's easiest - to think of unw_getcontext() as being identical to getcontext(). */ -#define unw_getcontext(uc) unw_tdep_getcontext(uc) - -/* Return 1 if register number R is a floating-point register, zero - otherwise. - This routine is signal-safe. */ -#define unw_is_fpreg(r) unw_tdep_is_fpreg(r) - -typedef unw_tdep_fpreg_t unw_fpreg_t; - -typedef struct unw_addr_space *unw_addr_space_t; - -/* Each target may define it's own set of flags, but bits 0-15 are - reserved for general libunwind-use. */ -#define UNW_PI_FLAG_FIRST_TDEP_BIT 16 -/* The information comes from a .debug_frame section. */ -#define UNW_PI_FLAG_DEBUG_FRAME 32 - -typedef struct unw_proc_info -{ - unw_word_t start_ip; /* first IP covered by this procedure */ - unw_word_t end_ip; /* first IP NOT covered by this procedure */ -#if defined(NEED_LAST_IP) - unw_word_t last_ip; /* first IP that could begin another procedure */ -#endif - unw_word_t lsda; /* address of lang.-spec. data area (if any) */ - unw_word_t handler; /* optional personality routine */ - unw_word_t gp; /* global-pointer value for this procedure */ - unw_word_t flags; /* misc. flags */ - - int format; /* unwind-info format (arch-specific) */ - int unwind_info_size; /* size of the information (if applicable) */ - void *unwind_info; /* unwind-info (arch-specific) */ - unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */ -} unw_proc_info_t; - -typedef int (*unw_reg_states_callback)(void *token, - void *reg_states_data, - size_t reg_states_data_size, - unw_word_t start_ip, unw_word_t end_ip); - -/* These are backend callback routines that provide access to the - state of a "remote" process. This can be used, for example, to - unwind another process through the ptrace() interface. */ -typedef struct unw_accessors -{ - /* Look up the unwind info associated with instruction-pointer IP. - On success, the routine fills in the PROC_INFO structure. */ - int (*find_proc_info)(unw_addr_space_t, unw_word_t, unw_proc_info_t *, - int, void *); - - /* Release any resources (e.g., memory) that were allocated for - the unwind info returned in by a previous call to - find_proc_info() with NEED_UNWIND_INFO set to 1. */ - void (*put_unwind_info)(unw_addr_space_t, unw_proc_info_t *, void *); - - /* Return the list-head of the dynamically registered unwind - info. */ - int (*get_dyn_info_list_addr)(unw_addr_space_t, unw_word_t *, void *); - - /* Access aligned word at address ADDR. The value is returned - according to the endianness of the host (e.g., if the host is - little-endian and the target is big-endian, access_mem() needs - to byte-swap the value before returning it). */ - int (*access_mem)(unw_addr_space_t, unw_word_t, unw_word_t *, int, - void *); - - /* Access register number REG at address ADDR. */ - int (*access_reg)(unw_addr_space_t, unw_regnum_t, unw_word_t *, int, - void *); - - /* Access register number REG at address ADDR. */ - int (*access_fpreg)(unw_addr_space_t, unw_regnum_t, - unw_fpreg_t *, int, void *); - - int (*resume)(unw_addr_space_t, unw_cursor_t *, void *); - - /* Optional call back to obtain the name of a (static) procedure. - Dynamically generated procedures are handled automatically by - libunwind. This callback is optional and may be set to - NULL. */ - int (*get_proc_name)(unw_addr_space_t, unw_word_t, char *, size_t, - unw_word_t *, void *); - - /* Optional call back to return a mask to be used with pointer - * authentication on arm64. - * - * The on bits in the returned mask indicate which bits in a return address - * are part of a pointer authentication code. These are the bits in the - * return address to turn off so that the calling frame can be found - * for the unwinding to continue. - * - * The return value must be host-endian. e.g. if the target is big-endian - * and the host is little endian, the implementation of this function - * must byte swap. - * - * This callback is optional and may be set to NULL. In this case all - * the bits in the return address are used, as if no masking were done. - */ - unw_word_t (*ptrauth_insn_mask) (unw_addr_space_t, void *); -} unw_accessors_t; - -typedef enum unw_save_loc_type -{ - UNW_SLT_NONE, /* register is not saved ("not an l-value") */ - UNW_SLT_MEMORY, /* register has been saved in memory */ - UNW_SLT_REG /* register has been saved in (another) register */ -} unw_save_loc_type_t; - -typedef struct unw_save_loc -{ - unw_save_loc_type_t type; - union { - unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */ - unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */ - } u; - unw_tdep_save_loc_t extra; /* target-dependent additional information */ -} unw_save_loc_t; - -/* Add For Cache MAP And ELF */ -typedef struct unw_map_cursor - { - void *map_list; - void *cur_map; - } -unw_map_cursor_t; - -typedef struct unw_map - { - unw_word_t start; - unw_word_t end; - char *path; - int flags; - } -unw_map_t; -/* Add For Cache MAP And ELF */ - -/* These routines work both for local and remote unwinding. */ - -#define unw_local_addr_space UNW_OBJ(local_addr_space) -#define unw_create_addr_space UNW_OBJ(create_addr_space) -#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space) -#define unw_get_accessors UNW_ARCH_OBJ(get_accessors) -#define unw_get_accessors_int UNW_ARCH_OBJ(get_accessors_int) -#define unw_init_local UNW_OBJ(init_local) -#define unw_init_local2 UNW_OBJ(init_local2) -#define unw_init_remote UNW_OBJ(init_remote) -#define unw_step UNW_OBJ(step) -#define unw_resume UNW_OBJ(resume) -#define unw_get_proc_info UNW_OBJ(get_proc_info) -#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip) -#define unw_reg_states_iterate UNW_OBJ(reg_states_iterate) -#define unw_apply_reg_state UNW_OBJ(apply_reg_state) -#define unw_get_reg UNW_OBJ(get_reg) -#define unw_set_reg UNW_OBJ(set_reg) -#define unw_get_fpreg UNW_OBJ(get_fpreg) -#define unw_set_fpreg UNW_OBJ(set_fpreg) -#define unw_get_save_loc UNW_OBJ(get_save_loc) -#define unw_is_signal_frame UNW_OBJ(is_signal_frame) -#define unw_handle_signal_frame UNW_OBJ(handle_signal_frame) -#define unw_get_proc_name UNW_OBJ(get_proc_name) -#define unw_set_caching_policy UNW_OBJ(set_caching_policy) -#define unw_set_cache_size UNW_OBJ(set_cache_size) -#define unw_regname UNW_ARCH_OBJ(regname) -#define unw_flush_cache UNW_ARCH_OBJ(flush_cache) -#define unw_strerror UNW_ARCH_OBJ(strerror) - -#define unw_init_local_addr_space UNW_OBJ(init_local_addr_space) -#define unw_init_local_with_as UNW_OBJ(init_local_with_as) - -extern unw_addr_space_t unw_create_addr_space(unw_accessors_t *, int); -extern void unw_destroy_addr_space(unw_addr_space_t); -extern unw_accessors_t *unw_get_accessors(unw_addr_space_t); -extern unw_accessors_t *unw_get_accessors_int(unw_addr_space_t); -extern void unw_flush_cache(unw_addr_space_t, unw_word_t, unw_word_t); -extern int unw_set_caching_policy(unw_addr_space_t, unw_caching_policy_t); -extern int unw_set_cache_size(unw_addr_space_t, size_t, int); -extern const char *unw_regname(unw_regnum_t); - -extern int unw_init_local(unw_cursor_t *, unw_context_t *); -extern int unw_init_local2(unw_cursor_t *, unw_context_t *, int); -extern int unw_init_remote(unw_cursor_t *, unw_addr_space_t, void *); -extern int unw_step(unw_cursor_t *); -extern int unw_resume(unw_cursor_t *); -extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *); -extern int unw_get_proc_info_by_ip(unw_addr_space_t, unw_word_t, - unw_proc_info_t *, void *); -extern int unw_reg_states_iterate(unw_cursor_t *, unw_reg_states_callback, void *); -extern int unw_apply_reg_state(unw_cursor_t *, void *); -extern int unw_get_reg(unw_cursor_t *, int, unw_word_t *); -extern int unw_set_reg(unw_cursor_t *, int, unw_word_t); -extern int unw_get_fpreg(unw_cursor_t *, int, unw_fpreg_t *); -extern int unw_set_fpreg(unw_cursor_t *, int, unw_fpreg_t); -extern int unw_get_save_loc(unw_cursor_t *, int, unw_save_loc_t *); -extern int unw_is_signal_frame(unw_cursor_t *); -extern int unw_handle_signal_frame(unw_cursor_t *); -extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *); -extern const char *unw_strerror(int); -extern int unw_backtrace(void **, int); - -extern void unw_map_set (unw_addr_space_t, unw_map_cursor_t *); -extern void unw_map_cursor_reset (unw_map_cursor_t *); -extern int unw_map_cursor_create (unw_map_cursor_t *, pid_t); -extern void unw_map_cursor_destroy (unw_map_cursor_t *); -extern int unw_map_cursor_get (unw_map_cursor_t *, unw_map_t *); - -extern unw_addr_space_t unw_local_addr_space; diff --git a/include/libunwind_i-ohos.h b/include/libunwind_i-ohos.h deleted file mode 100644 index 1ed7d30b..00000000 --- a/include/libunwind_i-ohos.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LIBUNWIND_I_OHOS_H -#define LIBUNWIND_I_OHOS_H -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include "libunwind_i.h" -#include "map_info.h" - -// set unwind context without modifing target memory -extern void unw_set_context(unw_cursor_t * cursor, uintptr_t regs[], int reg_sz); -// update adjust pc -extern void unw_set_adjust_pc(struct unw_cursor *cursor, uint64_t pc); -// Get relative pc from cursor or calculate it -extern unw_word_t unw_get_rel_pc (unw_cursor_t *); -// We may want to get previous executed address, thus previous instruction size is needed -// target dependent -extern unw_word_t unw_get_previous_instr_sz(unw_cursor_t *); -// Get current associated map -extern struct map_info* unw_get_map (unw_cursor_t *); -// Get map info list of current unwind target -extern struct map_info* unw_get_maps (unw_cursor_t *); -// Get build id from cached map info -extern bool unw_get_build_id(struct map_info* map, uint8_t** build_id_ptr, size_t* length); -// Get ark js heap crash info -extern int unw_get_ark_js_heap_crash_info(int pid, uintptr_t* x20, uintptr_t* fp, int out_js_info, char* buf, size_t buf_sz); -// Loop the symbol table to find matched symbol -extern int unw_get_symbol_info(struct unw_cursor *cursor, uint64_t pc, int buf_sz, char *buf, uint64_t *sym_start, uint64_t *sym_end); -// Set unwind process id, for caching maps -extern void unw_set_target_pid(unw_addr_space_t as, int pid); - -// Create caching maps for local uinwinding -extern void unw_init_local_address_space(unw_addr_space_t* as); -// Destory caching maps for local uinwinding -extern void unw_destroy_local_address_space(unw_addr_space_t as); -// Init cursor with other address space -extern int unw_init_local_with_as(unw_addr_space_t as, unw_cursor_t *cursor, unw_context_t *uc); -// Loop the symbol table to find matched symbol, only for local uinwinding -extern int unw_get_symbol_info_by_pc(unw_addr_space_t as, uint64_t pc, int buf_sz, char *buf, uint64_t *sym_start, uint64_t *sym_end); -// Get library name associated to specific map -extern int unw_get_library_name_by_map (struct map_info* map, char *buf, int buf_sz); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/include/map_info.h b/include/map_info.h deleted file mode 100644 index ae24908e..00000000 --- a/include/map_info.h +++ /dev/null @@ -1,50 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2013 The Android Open Source Project - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifndef map_info_h -#define map_info_h - -struct map_info - { - uintptr_t start; - uintptr_t end; - uintptr_t offset; - int flags; - char *path; - struct elf_image ei; - struct elf_image mdi; - int sz; - void* buf; - int buf_sz; - }; - -int maps_is_readable(struct map_info *map_list, unw_word_t addr); - -int maps_is_writable(struct map_info *map_list, unw_word_t addr); - -struct map_info *maps_create_list(pid_t pid); - -void maps_destroy_list(struct map_info *map_info); - -#endif /* map_info_h */ diff --git a/include/mingw/elf.h b/include/mingw/elf.h deleted file mode 100755 index e9a8ab01..00000000 --- a/include/mingw/elf.h +++ /dev/null @@ -1,15 +0,0 @@ -// This is an incomplete & imprecice implementation -// It defers to the open source freebsd-elf implementations. -#ifndef __MINGW_ELF__ -#define __MINGW_ELF__ - -#ifdef MINGW // Only for cross compilation to mingw - -#include - -#include "freebsd-elf_common.h" -#include "freebsd-elf32.h" -#include "freebsd-elf64.h" - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/mingw/endian.h b/include/mingw/endian.h deleted file mode 100755 index 3155f4bd..00000000 --- a/include/mingw/endian.h +++ /dev/null @@ -1,15 +0,0 @@ -// This is an incomplete & imprecice implementation of the -// standard file by the same name -#ifndef __MINGW_ENDIAN__ -#define __MINGW_ENDIAN__ - -#ifdef MINGW // Only for cross compilation to mingw - - -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 - -#define __BYTE_ORDER __LITTLE_ENDIAN - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/mingw/freebsd-elf32.h b/include/mingw/freebsd-elf32.h deleted file mode 100755 index b4c0d942..00000000 --- a/include/mingw/freebsd-elf32.h +++ /dev/null @@ -1,245 +0,0 @@ -/*- - * Copyright (c) 1996-1998 John D. Polstra. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $ - */ - -#ifndef _SYS_ELF32_H_ -#define _SYS_ELF32_H_ 1 - -#include "freebsd-elf_common.h" - -/* - * ELF definitions common to all 32-bit architectures. - */ - -typedef uint32_t Elf32_Addr; -typedef uint16_t Elf32_Half; -typedef uint32_t Elf32_Off; -typedef int32_t Elf32_Sword; -typedef uint32_t Elf32_Word; -typedef uint64_t Elf32_Lword; - -typedef Elf32_Word Elf32_Hashelt; - -/* Non-standard class-dependent datatype used for abstraction. */ -typedef Elf32_Word Elf32_Size; -typedef Elf32_Sword Elf32_Ssize; - -/* - * ELF header. - */ - -typedef struct { - unsigned char e_ident[EI_NIDENT]; /* File identification. */ - Elf32_Half e_type; /* File type. */ - Elf32_Half e_machine; /* Machine architecture. */ - Elf32_Word e_version; /* ELF format version. */ - Elf32_Addr e_entry; /* Entry point. */ - Elf32_Off e_phoff; /* Program header file offset. */ - Elf32_Off e_shoff; /* Section header file offset. */ - Elf32_Word e_flags; /* Architecture-specific flags. */ - Elf32_Half e_ehsize; /* Size of ELF header in bytes. */ - Elf32_Half e_phentsize; /* Size of program header entry. */ - Elf32_Half e_phnum; /* Number of program header entries. */ - Elf32_Half e_shentsize; /* Size of section header entry. */ - Elf32_Half e_shnum; /* Number of section header entries. */ - Elf32_Half e_shstrndx; /* Section name strings section. */ -} Elf32_Ehdr; - -/* - * Section header. - */ - -typedef struct { - Elf32_Word sh_name; /* Section name (index into the - section header string table). */ - Elf32_Word sh_type; /* Section type. */ - Elf32_Word sh_flags; /* Section flags. */ - Elf32_Addr sh_addr; /* Address in memory image. */ - Elf32_Off sh_offset; /* Offset in file. */ - Elf32_Word sh_size; /* Size in bytes. */ - Elf32_Word sh_link; /* Index of a related section. */ - Elf32_Word sh_info; /* Depends on section type. */ - Elf32_Word sh_addralign; /* Alignment in bytes. */ - Elf32_Word sh_entsize; /* Size of each entry in section. */ -} Elf32_Shdr; - -/* - * Program header. - */ - -typedef struct { - Elf32_Word p_type; /* Entry type. */ - Elf32_Off p_offset; /* File offset of contents. */ - Elf32_Addr p_vaddr; /* Virtual address in memory image. */ - Elf32_Addr p_paddr; /* Physical address (not used). */ - Elf32_Word p_filesz; /* Size of contents in file. */ - Elf32_Word p_memsz; /* Size of contents in memory. */ - Elf32_Word p_flags; /* Access permission flags. */ - Elf32_Word p_align; /* Alignment in memory and file. */ -} Elf32_Phdr; - -/* - * Dynamic structure. The ".dynamic" section contains an array of them. - */ - -typedef struct { - Elf32_Sword d_tag; /* Entry type. */ - union { - Elf32_Word d_val; /* Integer value. */ - Elf32_Addr d_ptr; /* Address value. */ - } d_un; -} Elf32_Dyn; - -/* - * Relocation entries. - */ - -/* Relocations that don't need an addend field. */ -typedef struct { - Elf32_Addr r_offset; /* Location to be relocated. */ - Elf32_Word r_info; /* Relocation type and symbol index. */ -} Elf32_Rel; - -/* Relocations that need an addend field. */ -typedef struct { - Elf32_Addr r_offset; /* Location to be relocated. */ - Elf32_Word r_info; /* Relocation type and symbol index. */ - Elf32_Sword r_addend; /* Addend. */ -} Elf32_Rela; - -/* Macros for accessing the fields of r_info. */ -#define ELF32_R_SYM(info) ((info) >> 8) -#define ELF32_R_TYPE(info) ((unsigned char)(info)) - -/* Macro for constructing r_info from field values. */ -#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) - -/* - * Note entry header - */ -typedef Elf_Note Elf32_Nhdr; - -/* - * Move entry - */ -typedef struct { - Elf32_Lword m_value; /* symbol value */ - Elf32_Word m_info; /* size + index */ - Elf32_Word m_poffset; /* symbol offset */ - Elf32_Half m_repeat; /* repeat count */ - Elf32_Half m_stride; /* stride info */ -} Elf32_Move; - -/* - * The macros compose and decompose values for Move.r_info - * - * sym = ELF32_M_SYM(M.m_info) - * size = ELF32_M_SIZE(M.m_info) - * M.m_info = ELF32_M_INFO(sym, size) - */ -#define ELF32_M_SYM(info) ((info)>>8) -#define ELF32_M_SIZE(info) ((unsigned char)(info)) -#define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) - -/* - * Hardware/Software capabilities entry - */ -typedef struct { - Elf32_Word c_tag; /* how to interpret value */ - union { - Elf32_Word c_val; - Elf32_Addr c_ptr; - } c_un; -} Elf32_Cap; - -/* - * Symbol table entries. - */ - -typedef struct { - Elf32_Word st_name; /* String table index of name. */ - Elf32_Addr st_value; /* Symbol value. */ - Elf32_Word st_size; /* Size of associated object. */ - unsigned char st_info; /* Type and binding information. */ - unsigned char st_other; /* Reserved (not used). */ - Elf32_Half st_shndx; /* Section index of symbol. */ -} Elf32_Sym; - -/* Macros for accessing the fields of st_info. */ -#define ELF32_ST_BIND(info) ((info) >> 4) -#define ELF32_ST_TYPE(info) ((info) & 0xf) - -/* Macro for constructing st_info from field values. */ -#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) - -/* Macro for accessing the fields of st_other. */ -#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3) - -/* Structures used by Sun & GNU symbol versioning. */ -typedef struct -{ - Elf32_Half vd_version; - Elf32_Half vd_flags; - Elf32_Half vd_ndx; - Elf32_Half vd_cnt; - Elf32_Word vd_hash; - Elf32_Word vd_aux; - Elf32_Word vd_next; -} Elf32_Verdef; - -typedef struct -{ - Elf32_Word vda_name; - Elf32_Word vda_next; -} Elf32_Verdaux; - -typedef struct -{ - Elf32_Half vn_version; - Elf32_Half vn_cnt; - Elf32_Word vn_file; - Elf32_Word vn_aux; - Elf32_Word vn_next; -} Elf32_Verneed; - -typedef struct -{ - Elf32_Word vna_hash; - Elf32_Half vna_flags; - Elf32_Half vna_other; - Elf32_Word vna_name; - Elf32_Word vna_next; -} Elf32_Vernaux; - -typedef Elf32_Half Elf32_Versym; - -typedef struct { - Elf32_Half si_boundto; /* direct bindings - symbol bound to */ - Elf32_Half si_flags; /* per symbol flags */ -} Elf32_Syminfo; - -#endif /* !_SYS_ELF32_H_ */ diff --git a/include/mingw/freebsd-elf64.h b/include/mingw/freebsd-elf64.h deleted file mode 100755 index 0991fe35..00000000 --- a/include/mingw/freebsd-elf64.h +++ /dev/null @@ -1,252 +0,0 @@ -/*- - * Copyright (c) 1996-1998 John D. Polstra. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $ - */ - -#ifndef _SYS_ELF64_H_ -#define _SYS_ELF64_H_ 1 - -#include "freebsd-elf_common.h" - -/* - * ELF definitions common to all 64-bit architectures. - */ - -typedef uint64_t Elf64_Addr; -typedef uint16_t Elf64_Half; -typedef uint64_t Elf64_Off; -typedef int32_t Elf64_Sword; -typedef int64_t Elf64_Sxword; -typedef uint32_t Elf64_Word; -typedef uint64_t Elf64_Lword; -typedef uint64_t Elf64_Xword; - -/* - * Types of dynamic symbol hash table bucket and chain elements. - * - * This is inconsistent among 64 bit architectures, so a machine dependent - * typedef is required. - */ - -#ifdef __alpha__ -typedef Elf64_Off Elf64_Hashelt; -#else -typedef Elf64_Word Elf64_Hashelt; -#endif - -/* Non-standard class-dependent datatype used for abstraction. */ -typedef Elf64_Xword Elf64_Size; -typedef Elf64_Sxword Elf64_Ssize; - -/* - * ELF header. - */ - -typedef struct { - unsigned char e_ident[EI_NIDENT]; /* File identification. */ - Elf64_Half e_type; /* File type. */ - Elf64_Half e_machine; /* Machine architecture. */ - Elf64_Word e_version; /* ELF format version. */ - Elf64_Addr e_entry; /* Entry point. */ - Elf64_Off e_phoff; /* Program header file offset. */ - Elf64_Off e_shoff; /* Section header file offset. */ - Elf64_Word e_flags; /* Architecture-specific flags. */ - Elf64_Half e_ehsize; /* Size of ELF header in bytes. */ - Elf64_Half e_phentsize; /* Size of program header entry. */ - Elf64_Half e_phnum; /* Number of program header entries. */ - Elf64_Half e_shentsize; /* Size of section header entry. */ - Elf64_Half e_shnum; /* Number of section header entries. */ - Elf64_Half e_shstrndx; /* Section name strings section. */ -} Elf64_Ehdr; - -/* - * Section header. - */ - -typedef struct { - Elf64_Word sh_name; /* Section name (index into the - section header string table). */ - Elf64_Word sh_type; /* Section type. */ - Elf64_Xword sh_flags; /* Section flags. */ - Elf64_Addr sh_addr; /* Address in memory image. */ - Elf64_Off sh_offset; /* Offset in file. */ - Elf64_Xword sh_size; /* Size in bytes. */ - Elf64_Word sh_link; /* Index of a related section. */ - Elf64_Word sh_info; /* Depends on section type. */ - Elf64_Xword sh_addralign; /* Alignment in bytes. */ - Elf64_Xword sh_entsize; /* Size of each entry in section. */ -} Elf64_Shdr; - -/* - * Program header. - */ - -typedef struct { - Elf64_Word p_type; /* Entry type. */ - Elf64_Word p_flags; /* Access permission flags. */ - Elf64_Off p_offset; /* File offset of contents. */ - Elf64_Addr p_vaddr; /* Virtual address in memory image. */ - Elf64_Addr p_paddr; /* Physical address (not used). */ - Elf64_Xword p_filesz; /* Size of contents in file. */ - Elf64_Xword p_memsz; /* Size of contents in memory. */ - Elf64_Xword p_align; /* Alignment in memory and file. */ -} Elf64_Phdr; - -/* - * Dynamic structure. The ".dynamic" section contains an array of them. - */ - -typedef struct { - Elf64_Sxword d_tag; /* Entry type. */ - union { - Elf64_Xword d_val; /* Integer value. */ - Elf64_Addr d_ptr; /* Address value. */ - } d_un; -} Elf64_Dyn; - -/* - * Relocation entries. - */ - -/* Relocations that don't need an addend field. */ -typedef struct { - Elf64_Addr r_offset; /* Location to be relocated. */ - Elf64_Xword r_info; /* Relocation type and symbol index. */ -} Elf64_Rel; - -/* Relocations that need an addend field. */ -typedef struct { - Elf64_Addr r_offset; /* Location to be relocated. */ - Elf64_Xword r_info; /* Relocation type and symbol index. */ - Elf64_Sxword r_addend; /* Addend. */ -} Elf64_Rela; - -/* Macros for accessing the fields of r_info. */ -#define ELF64_R_SYM(info) ((info) >> 32) -#define ELF64_R_TYPE(info) ((info) & 0xffffffffL) - -/* Macro for constructing r_info from field values. */ -#define ELF64_R_INFO(sym, type) (((sym) << 32) + ((type) & 0xffffffffL)) - -#define ELF64_R_TYPE_DATA(info) (((Elf64_Xword)(info)<<32)>>40) -#define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56) -#define ELF64_R_TYPE_INFO(data, type) \ - (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type)) - -/* - * Note entry header - */ -typedef Elf_Note Elf64_Nhdr; - -/* - * Move entry - */ -typedef struct { - Elf64_Lword m_value; /* symbol value */ - Elf64_Xword m_info; /* size + index */ - Elf64_Xword m_poffset; /* symbol offset */ - Elf64_Half m_repeat; /* repeat count */ - Elf64_Half m_stride; /* stride info */ -} Elf64_Move; - -#define ELF64_M_SYM(info) ((info)>>8) -#define ELF64_M_SIZE(info) ((unsigned char)(info)) -#define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) - -/* - * Hardware/Software capabilities entry - */ -typedef struct { - Elf64_Xword c_tag; /* how to interpret value */ - union { - Elf64_Xword c_val; - Elf64_Addr c_ptr; - } c_un; -} Elf64_Cap; - -/* - * Symbol table entries. - */ - -typedef struct { - Elf64_Word st_name; /* String table index of name. */ - unsigned char st_info; /* Type and binding information. */ - unsigned char st_other; /* Reserved (not used). */ - Elf64_Half st_shndx; /* Section index of symbol. */ - Elf64_Addr st_value; /* Symbol value. */ - Elf64_Xword st_size; /* Size of associated object. */ -} Elf64_Sym; - -/* Macros for accessing the fields of st_info. */ -#define ELF64_ST_BIND(info) ((info) >> 4) -#define ELF64_ST_TYPE(info) ((info) & 0xf) - -/* Macro for constructing st_info from field values. */ -#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) - -/* Macro for accessing the fields of st_other. */ -#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3) - -/* Structures used by Sun & GNU-style symbol versioning. */ -typedef struct { - Elf64_Half vd_version; - Elf64_Half vd_flags; - Elf64_Half vd_ndx; - Elf64_Half vd_cnt; - Elf64_Word vd_hash; - Elf64_Word vd_aux; - Elf64_Word vd_next; -} Elf64_Verdef; - -typedef struct { - Elf64_Word vda_name; - Elf64_Word vda_next; -} Elf64_Verdaux; - -typedef struct { - Elf64_Half vn_version; - Elf64_Half vn_cnt; - Elf64_Word vn_file; - Elf64_Word vn_aux; - Elf64_Word vn_next; -} Elf64_Verneed; - -typedef struct { - Elf64_Word vna_hash; - Elf64_Half vna_flags; - Elf64_Half vna_other; - Elf64_Word vna_name; - Elf64_Word vna_next; -} Elf64_Vernaux; - -typedef Elf64_Half Elf64_Versym; - -typedef struct { - Elf64_Half si_boundto; /* direct bindings - symbol bound to */ - Elf64_Half si_flags; /* per symbol flags */ -} Elf64_Syminfo; - -#endif /* !_SYS_ELF64_H_ */ diff --git a/include/mingw/freebsd-elf_common.h b/include/mingw/freebsd-elf_common.h deleted file mode 100755 index 7aef2d49..00000000 --- a/include/mingw/freebsd-elf_common.h +++ /dev/null @@ -1,865 +0,0 @@ -/*- - * Copyright (c) 1998 John D. Polstra. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/elf_common.h,v 1.24 2008/08/02 01:20:10 imp Exp $ - */ - -#ifndef _SYS_ELF_COMMON_H_ -#define _SYS_ELF_COMMON_H_ 1 - -/* - * ELF definitions that are independent of architecture or word size. - */ - -/* - * Note header. The ".note" section contains an array of notes. Each - * begins with this header, aligned to a word boundary. Immediately - * following the note header is n_namesz bytes of name, padded to the - * next word boundary. Then comes n_descsz bytes of descriptor, again - * padded to a word boundary. The values of n_namesz and n_descsz do - * not include the padding. - */ - -typedef struct { - uint32_t n_namesz; /* Length of name. */ - uint32_t n_descsz; /* Length of descriptor. */ - uint32_t n_type; /* Type of this note. */ -} Elf_Note; - -/* Indexes into the e_ident array. Keep synced with - http://www.sco.com/developers/gabi/latest/ch4.eheader.html */ -#define EI_MAG0 0 /* Magic number, byte 0. */ -#define EI_MAG1 1 /* Magic number, byte 1. */ -#define EI_MAG2 2 /* Magic number, byte 2. */ -#define EI_MAG3 3 /* Magic number, byte 3. */ -#define EI_CLASS 4 /* Class of machine. */ -#define EI_DATA 5 /* Data format. */ -#define EI_VERSION 6 /* ELF format version. */ -#define EI_OSABI 7 /* Operating system / ABI identification */ -#define EI_ABIVERSION 8 /* ABI version */ -#define OLD_EI_BRAND 8 /* Start of architecture identification. */ -#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ -#define EI_NIDENT 16 /* Size of e_ident array. */ - -/* Values for the magic number bytes. */ -#define ELFMAG0 0x7f -#define ELFMAG1 'E' -#define ELFMAG2 'L' -#define ELFMAG3 'F' -#define ELFMAG "\177ELF" /* magic string */ -#define SELFMAG 4 /* magic string size */ - -/* Values for e_ident[EI_VERSION] and e_version. */ -#define EV_NONE 0 -#define EV_CURRENT 1 - -/* Values for e_ident[EI_CLASS]. */ -#define ELFCLASSNONE 0 /* Unknown class. */ -#define ELFCLASS32 1 /* 32-bit architecture. */ -#define ELFCLASS64 2 /* 64-bit architecture. */ - -/* Values for e_ident[EI_DATA]. */ -#define ELFDATANONE 0 /* Unknown data format. */ -#define ELFDATA2LSB 1 /* 2's complement little-endian. */ -#define ELFDATA2MSB 2 /* 2's complement big-endian. */ - -/* Values for e_ident[EI_OSABI]. */ -#define ELFOSABI_NONE 0 /* UNIX System V ABI */ -#define ELFOSABI_HPUX 1 /* HP-UX operating system */ -#define ELFOSABI_NETBSD 2 /* NetBSD */ -#define ELFOSABI_LINUX 3 /* GNU/Linux */ -#define ELFOSABI_HURD 4 /* GNU/Hurd */ -#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ -#define ELFOSABI_SOLARIS 6 /* Solaris */ -#define ELFOSABI_AIX 7 /* AIX */ -#define ELFOSABI_IRIX 8 /* IRIX */ -#define ELFOSABI_FREEBSD 9 /* FreeBSD */ -#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ -#define ELFOSABI_MODESTO 11 /* Novell Modesto */ -#define ELFOSABI_OPENBSD 12 /* OpenBSD */ -#define ELFOSABI_OPENVMS 13 /* Open VMS */ -#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ -#define ELFOSABI_ARM 97 /* ARM */ -#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ - -#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */ -#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */ - -/* e_ident */ -#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ - (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ - (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ - (ehdr).e_ident[EI_MAG3] == ELFMAG3) - -/* Values for e_type. */ -#define ET_NONE 0 /* Unknown type. */ -#define ET_REL 1 /* Relocatable. */ -#define ET_EXEC 2 /* Executable. */ -#define ET_DYN 3 /* Shared object. */ -#define ET_CORE 4 /* Core file. */ -#define ET_LOOS 0xfe00 /* First operating system specific. */ -#define ET_HIOS 0xfeff /* Last operating system-specific. */ -#define ET_LOPROC 0xff00 /* First processor-specific. */ -#define ET_HIPROC 0xffff /* Last processor-specific. */ - -/* Values for e_machine. */ -#define EM_NONE 0 /* Unknown machine. */ -#define EM_M32 1 /* AT&T WE32100. */ -#define EM_SPARC 2 /* Sun SPARC. */ -#define EM_386 3 /* Intel i386. */ -#define EM_68K 4 /* Motorola 68000. */ -#define EM_88K 5 /* Motorola 88000. */ -#define EM_860 7 /* Intel i860. */ -#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */ -#define EM_S370 9 /* IBM System/370. */ -#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */ -#define EM_PARISC 15 /* HP PA-RISC. */ -#define EM_VPP500 17 /* Fujitsu VPP500. */ -#define EM_SPARC32PLUS 18 /* SPARC v8plus. */ -#define EM_960 19 /* Intel 80960. */ -#define EM_PPC 20 /* PowerPC 32-bit. */ -#define EM_PPC64 21 /* PowerPC 64-bit. */ -#define EM_S390 22 /* IBM System/390. */ -#define EM_V800 36 /* NEC V800. */ -#define EM_FR20 37 /* Fujitsu FR20. */ -#define EM_RH32 38 /* TRW RH-32. */ -#define EM_RCE 39 /* Motorola RCE. */ -#define EM_ARM 40 /* ARM. */ -#define EM_SH 42 /* Hitachi SH. */ -#define EM_SPARCV9 43 /* SPARC v9 64-bit. */ -#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */ -#define EM_ARC 45 /* Argonaut RISC Core. */ -#define EM_H8_300 46 /* Hitachi H8/300. */ -#define EM_H8_300H 47 /* Hitachi H8/300H. */ -#define EM_H8S 48 /* Hitachi H8S. */ -#define EM_H8_500 49 /* Hitachi H8/500. */ -#define EM_IA_64 50 /* Intel IA-64 Processor. */ -#define EM_MIPS_X 51 /* Stanford MIPS-X. */ -#define EM_COLDFIRE 52 /* Motorola ColdFire. */ -#define EM_68HC12 53 /* Motorola M68HC12. */ -#define EM_MMA 54 /* Fujitsu MMA. */ -#define EM_PCP 55 /* Siemens PCP. */ -#define EM_NCPU 56 /* Sony nCPU. */ -#define EM_NDR1 57 /* Denso NDR1 microprocessor. */ -#define EM_STARCORE 58 /* Motorola Star*Core processor. */ -#define EM_ME16 59 /* Toyota ME16 processor. */ -#define EM_ST100 60 /* STMicroelectronics ST100 processor. */ -#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ -#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ -#define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */ - -/* Non-standard or deprecated. */ -#define EM_486 6 /* Intel i486. */ -#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ -#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */ -#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */ - -/* Special section indexes. */ -#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ -#define SHN_LORESERVE 0xff00 /* First of reserved range. */ -#define SHN_LOPROC 0xff00 /* First processor-specific. */ -#define SHN_HIPROC 0xff1f /* Last processor-specific. */ -#define SHN_LOOS 0xff20 /* First operating system-specific. */ -#define SHN_HIOS 0xff3f /* Last operating system-specific. */ -#define SHN_ABS 0xfff1 /* Absolute values. */ -#define SHN_COMMON 0xfff2 /* Common data. */ -#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */ -#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ - -/* sh_type */ -#define SHT_NULL 0 /* inactive */ -#define SHT_PROGBITS 1 /* program defined information */ -#define SHT_SYMTAB 2 /* symbol table section */ -#define SHT_STRTAB 3 /* string table section */ -#define SHT_RELA 4 /* relocation section with addends */ -#define SHT_HASH 5 /* symbol hash table section */ -#define SHT_DYNAMIC 6 /* dynamic section */ -#define SHT_NOTE 7 /* note section */ -#define SHT_NOBITS 8 /* no space section */ -#define SHT_REL 9 /* relocation section - no addends */ -#define SHT_SHLIB 10 /* reserved - purpose unknown */ -#define SHT_DYNSYM 11 /* dynamic symbol table section */ -#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ -#define SHT_FINI_ARRAY 15 /* Termination function pointers. */ -#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ -#define SHT_GROUP 17 /* Section group. */ -#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */ -#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ -#define SHT_LOSUNW 0x6ffffff4 -#define SHT_SUNW_dof 0x6ffffff4 -#define SHT_SUNW_cap 0x6ffffff5 -#define SHT_SUNW_SIGNATURE 0x6ffffff6 -#define SHT_SUNW_ANNOTATE 0x6ffffff7 -#define SHT_SUNW_DEBUGSTR 0x6ffffff8 -#define SHT_SUNW_DEBUG 0x6ffffff9 -#define SHT_SUNW_move 0x6ffffffa -#define SHT_SUNW_COMDAT 0x6ffffffb -#define SHT_SUNW_syminfo 0x6ffffffc -#define SHT_SUNW_verdef 0x6ffffffd -#define SHT_GNU_verdef 0x6ffffffd /* Symbol versions provided */ -#define SHT_SUNW_verneed 0x6ffffffe -#define SHT_GNU_verneed 0x6ffffffe /* Symbol versions required */ -#define SHT_SUNW_versym 0x6fffffff -#define SHT_GNU_versym 0x6fffffff /* Symbol version table */ -#define SHT_HISUNW 0x6fffffff -#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ -#define SHT_LOPROC 0x70000000 /* reserved range for processor */ -#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ -#define SHT_HIPROC 0x7fffffff /* specific section header types */ -#define SHT_LOUSER 0x80000000 /* reserved range for application */ -#define SHT_HIUSER 0xffffffff /* specific indexes */ - -/* Flags for sh_flags. */ -#define SHF_WRITE 0x1 /* Section contains writable data. */ -#define SHF_ALLOC 0x2 /* Section occupies memory. */ -#define SHF_EXECINSTR 0x4 /* Section contains instructions. */ -#define SHF_MERGE 0x10 /* Section may be merged. */ -#define SHF_STRINGS 0x20 /* Section contains strings. */ -#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */ -#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */ -#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ -#define SHF_GROUP 0x200 /* Member of section group. */ -#define SHF_TLS 0x400 /* Section contains TLS data. */ -#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ -#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ - -/* Values for p_type. */ -#define PT_NULL 0 /* Unused entry. */ -#define PT_LOAD 1 /* Loadable segment. */ -#define PT_DYNAMIC 2 /* Dynamic linking information segment. */ -#define PT_INTERP 3 /* Pathname of interpreter. */ -#define PT_NOTE 4 /* Auxiliary information. */ -#define PT_SHLIB 5 /* Reserved (not used). */ -#define PT_PHDR 6 /* Location of program header itself. */ -#define PT_TLS 7 /* Thread local storage segment */ -#define PT_LOOS 0x60000000 /* First OS-specific. */ -#define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */ -#define PT_GNU_EH_FRAME 0x6474e550 -#define PT_GNU_STACK 0x6474e551 -#define PT_LOSUNW 0x6ffffffa -#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ -#define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ -#define PT_SUNWDTRACE 0x6ffffffc /* private */ -#define PT_SUNWCAP 0x6ffffffd /* hard/soft capabilities segment */ -#define PT_HISUNW 0x6fffffff -#define PT_HIOS 0x6fffffff /* Last OS-specific. */ -#define PT_LOPROC 0x70000000 /* First processor-specific type. */ -#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ - -/* Values for p_flags. */ -#define PF_X 0x1 /* Executable. */ -#define PF_W 0x2 /* Writable. */ -#define PF_R 0x4 /* Readable. */ -#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */ -#define PF_MASKPROC 0xf0000000 /* Processor-specific. */ - -/* Extended program header index. */ -#define PN_XNUM 0xffff - -/* Values for d_tag. */ -#define DT_NULL 0 /* Terminating entry. */ -#define DT_NEEDED 1 /* String table offset of a needed shared - library. */ -#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */ -#define DT_PLTGOT 3 /* Processor-dependent address. */ -#define DT_HASH 4 /* Address of symbol hash table. */ -#define DT_STRTAB 5 /* Address of string table. */ -#define DT_SYMTAB 6 /* Address of symbol table. */ -#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ -#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ -#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ -#define DT_STRSZ 10 /* Size of string table. */ -#define DT_SYMENT 11 /* Size of each symbol table entry. */ -#define DT_INIT 12 /* Address of initialization function. */ -#define DT_FINI 13 /* Address of finalization function. */ -#define DT_SONAME 14 /* String table offset of shared object - name. */ -#define DT_RPATH 15 /* String table offset of library path. [sup] */ -#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */ -#define DT_REL 17 /* Address of ElfNN_Rel relocations. */ -#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */ -#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */ -#define DT_PLTREL 20 /* Type of relocation used for PLT. */ -#define DT_DEBUG 21 /* Reserved (not used). */ -#define DT_TEXTREL 22 /* Indicates there may be relocations in - non-writable segments. [sup] */ -#define DT_JMPREL 23 /* Address of PLT relocations. */ -#define DT_BIND_NOW 24 /* [sup] */ -#define DT_INIT_ARRAY 25 /* Address of the array of pointers to - initialization functions */ -#define DT_FINI_ARRAY 26 /* Address of the array of pointers to - termination functions */ -#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of - initialization functions. */ -#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of - terminationfunctions. */ -#define DT_RUNPATH 29 /* String table offset of a null-terminated - library search path string. */ -#define DT_FLAGS 30 /* Object specific flag values. */ -#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING - and less than DT_LOOS follow the rules for - the interpretation of the d_un union - as follows: even == 'd_ptr', even == 'd_val' - or none */ -#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to - pre-initialization functions. */ -#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of - pre-initialization functions. */ -#define DT_MAXPOSTAGS 34 /* number of positive tags */ -#define DT_LOOS 0x6000000d /* First OS-specific */ -#define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */ -#define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */ -#define DT_SUNW_FILTER 0x6000000f /* symbol filter name */ -#define DT_SUNW_CAP 0x60000010 /* hardware/software */ -#define DT_HIOS 0x6ffff000 /* Last OS-specific */ - -/* - * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the - * Dyn.d_un.d_val field of the Elf*_Dyn structure. - */ -#define DT_VALRNGLO 0x6ffffd00 -#define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */ -#define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */ -#define DT_MOVEENT 0x6ffffdfa /* move table entry size */ -#define DT_MOVESZ 0x6ffffdfb /* move table size */ -#define DT_FEATURE_1 0x6ffffdfc /* feature holder */ -#define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */ - /* the following DT_* entry. */ - /* See DF_P1_* definitions */ -#define DT_SYMINSZ 0x6ffffdfe /* syminfo table size (in bytes) */ -#define DT_SYMINENT 0x6ffffdff /* syminfo entry size (in bytes) */ -#define DT_VALRNGHI 0x6ffffdff - -/* - * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the - * Dyn.d_un.d_ptr field of the Elf*_Dyn structure. - * - * If any adjustment is made to the ELF object after it has been - * built, these entries will need to be adjusted. - */ -#define DT_ADDRRNGLO 0x6ffffe00 -#define DT_CONFIG 0x6ffffefa /* configuration information */ -#define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */ -#define DT_AUDIT 0x6ffffefc /* object auditing */ -#define DT_PLTPAD 0x6ffffefd /* pltpadding (sparcv9) */ -#define DT_MOVETAB 0x6ffffefe /* move table */ -#define DT_SYMINFO 0x6ffffeff /* syminfo table */ -#define DT_ADDRRNGHI 0x6ffffeff - -#define DT_VERSYM 0x6ffffff0 /* Address of versym section. */ -#define DT_RELACOUNT 0x6ffffff9 /* number of RELATIVE relocations */ -#define DT_RELCOUNT 0x6ffffffa /* number of RELATIVE relocations */ -#define DT_FLAGS_1 0x6ffffffb /* state flags - see DF_1_* defs */ -#define DT_VERDEF 0x6ffffffc /* Address of verdef section. */ -#define DT_VERDEFNUM 0x6ffffffd /* Number of elems in verdef section */ -#define DT_VERNEED 0x6ffffffe /* Address of verneed section. */ -#define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */ - -#define DT_LOPROC 0x70000000 /* First processor-specific type. */ -#define DT_DEPRECATED_SPARC_REGISTER 0x7000001 -#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */ -#define DT_USED 0x7ffffffe /* ignored - same as needed */ -#define DT_FILTER 0x7fffffff /* shared library filter name */ -#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */ - -/* Values for DT_FLAGS */ -#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may - make reference to the $ORIGIN substitution - string */ -#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */ -#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in - non-writable segments. */ -#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should - process all relocations for the object - containing this entry before transferring - control to the program. */ -#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or - executable contains code using a static - thread-local storage scheme. */ - -/* Values for n_type. Used in core files. */ -#define NT_PRSTATUS 1 /* Process status. */ -#define NT_FPREGSET 2 /* Floating point registers. */ -#define NT_PRPSINFO 3 /* Process state info. */ - -/* Symbol Binding - ELFNN_ST_BIND - st_info */ -#define STB_LOCAL 0 /* Local symbol */ -#define STB_GLOBAL 1 /* Global symbol */ -#define STB_WEAK 2 /* like global - lower precedence */ -#define STB_LOOS 10 /* Reserved range for operating system */ -#define STB_HIOS 12 /* specific semantics. */ -#define STB_LOPROC 13 /* reserved range for processor */ -#define STB_HIPROC 15 /* specific semantics. */ - -/* Symbol type - ELFNN_ST_TYPE - st_info */ -#define STT_NOTYPE 0 /* Unspecified type. */ -#define STT_OBJECT 1 /* Data object. */ -#define STT_FUNC 2 /* Function. */ -#define STT_SECTION 3 /* Section. */ -#define STT_FILE 4 /* Source file. */ -#define STT_COMMON 5 /* Uninitialized common block. */ -#define STT_TLS 6 /* TLS object. */ -#define STT_NUM 7 -#define STT_LOOS 10 /* Reserved range for operating system */ -#define STT_HIOS 12 /* specific semantics. */ -#define STT_LOPROC 13 /* reserved range for processor */ -#define STT_HIPROC 15 /* specific semantics. */ - -/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ -#define STV_DEFAULT 0x0 /* Default visibility (see binding). */ -#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */ -#define STV_HIDDEN 0x2 /* Not visible. */ -#define STV_PROTECTED 0x3 /* Visible but not preemptible. */ -#define STV_EXPORTED 0x4 -#define STV_SINGLETON 0x5 -#define STV_ELIMINATE 0x6 - -/* Special symbol table indexes. */ -#define STN_UNDEF 0 /* Undefined symbol index. */ - -/* Symbol versioning flags. */ -#define VER_DEF_CURRENT 1 -#define VER_DEF_IDX(x) VER_NDX(x) - -#define VER_FLG_BASE 0x01 -#define VER_FLG_WEAK 0x02 - -#define VER_NEED_CURRENT 1 -#define VER_NEED_WEAK (1u << 15) -#define VER_NEED_HIDDEN VER_NDX_HIDDEN -#define VER_NEED_IDX(x) VER_NDX(x) - -#define VER_NDX_LOCAL 0 -#define VER_NDX_GLOBAL 1 -#define VER_NDX_GIVEN 2 - -#define VER_NDX_HIDDEN (1u << 15) -#define VER_NDX(x) ((x) & ~(1u << 15)) - -#define CA_SUNW_NULL 0 -#define CA_SUNW_HW_1 1 /* first hardware capabilities entry */ -#define CA_SUNW_SF_1 2 /* first software capabilities entry */ - -/* - * Syminfo flag values - */ -#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association */ - /* to object containing defn. */ -#define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */ -#define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */ -#define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be */ - /* lazily-loaded */ -#define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to */ - /* object containing defn. */ -#define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference */ - /* directly bind to this symbol */ -#define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */ -#define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */ - -/* - * Syminfo.si_boundto values. - */ -#define SYMINFO_BT_SELF 0xffff /* symbol bound to self */ -#define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */ -#define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */ -#define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */ -#define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */ - -/* - * Syminfo version values. - */ -#define SYMINFO_NONE 0 /* Syminfo version */ -#define SYMINFO_CURRENT 1 -#define SYMINFO_NUM 2 - -/* - * Relocation types. - * - * All machine architectures are defined here to allow tools on one to - * handle others. - */ - -#define R_386_NONE 0 /* No relocation. */ -#define R_386_32 1 /* Add symbol value. */ -#define R_386_PC32 2 /* Add PC-relative symbol value. */ -#define R_386_GOT32 3 /* Add PC-relative GOT offset. */ -#define R_386_PLT32 4 /* Add PC-relative PLT offset. */ -#define R_386_COPY 5 /* Copy data from shared object. */ -#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ -#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */ -#define R_386_RELATIVE 8 /* Add load address of shared object. */ -#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ -#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ -#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */ -#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */ -#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */ -#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */ -#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */ -#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */ -#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */ -#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */ -#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */ -#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */ -#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */ -#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */ -#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */ -#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */ -#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */ -#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */ -#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */ -#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */ -#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */ -#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ - -#define R_ARM_NONE 0 /* No relocation. */ -#define R_ARM_PC24 1 -#define R_ARM_ABS32 2 -#define R_ARM_REL32 3 -#define R_ARM_PC13 4 -#define R_ARM_ABS16 5 -#define R_ARM_ABS12 6 -#define R_ARM_THM_ABS5 7 -#define R_ARM_ABS8 8 -#define R_ARM_SBREL32 9 -#define R_ARM_THM_PC22 10 -#define R_ARM_THM_PC8 11 -#define R_ARM_AMP_VCALL9 12 -#define R_ARM_SWI24 13 -#define R_ARM_THM_SWI8 14 -#define R_ARM_XPC25 15 -#define R_ARM_THM_XPC22 16 -#define R_ARM_COPY 20 /* Copy data from shared object. */ -#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ -#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ -#define R_ARM_RELATIVE 23 /* Add load address of shared object. */ -#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */ -#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */ -#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */ -#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */ -#define R_ARM_GNU_VTENTRY 100 -#define R_ARM_GNU_VTINHERIT 101 -#define R_ARM_RSBREL32 250 -#define R_ARM_THM_RPC22 251 -#define R_ARM_RREL32 252 -#define R_ARM_RABS32 253 -#define R_ARM_RPC24 254 -#define R_ARM_RBASE 255 - -/* Name Value Field Calculation */ -#define R_IA_64_NONE 0 /* None */ -#define R_IA_64_IMM14 0x21 /* immediate14 S + A */ -#define R_IA_64_IMM22 0x22 /* immediate22 S + A */ -#define R_IA_64_IMM64 0x23 /* immediate64 S + A */ -#define R_IA_64_DIR32MSB 0x24 /* word32 MSB S + A */ -#define R_IA_64_DIR32LSB 0x25 /* word32 LSB S + A */ -#define R_IA_64_DIR64MSB 0x26 /* word64 MSB S + A */ -#define R_IA_64_DIR64LSB 0x27 /* word64 LSB S + A */ -#define R_IA_64_GPREL22 0x2a /* immediate22 @gprel(S + A) */ -#define R_IA_64_GPREL64I 0x2b /* immediate64 @gprel(S + A) */ -#define R_IA_64_GPREL32MSB 0x2c /* word32 MSB @gprel(S + A) */ -#define R_IA_64_GPREL32LSB 0x2d /* word32 LSB @gprel(S + A) */ -#define R_IA_64_GPREL64MSB 0x2e /* word64 MSB @gprel(S + A) */ -#define R_IA_64_GPREL64LSB 0x2f /* word64 LSB @gprel(S + A) */ -#define R_IA_64_LTOFF22 0x32 /* immediate22 @ltoff(S + A) */ -#define R_IA_64_LTOFF64I 0x33 /* immediate64 @ltoff(S + A) */ -#define R_IA_64_PLTOFF22 0x3a /* immediate22 @pltoff(S + A) */ -#define R_IA_64_PLTOFF64I 0x3b /* immediate64 @pltoff(S + A) */ -#define R_IA_64_PLTOFF64MSB 0x3e /* word64 MSB @pltoff(S + A) */ -#define R_IA_64_PLTOFF64LSB 0x3f /* word64 LSB @pltoff(S + A) */ -#define R_IA_64_FPTR64I 0x43 /* immediate64 @fptr(S + A) */ -#define R_IA_64_FPTR32MSB 0x44 /* word32 MSB @fptr(S + A) */ -#define R_IA_64_FPTR32LSB 0x45 /* word32 LSB @fptr(S + A) */ -#define R_IA_64_FPTR64MSB 0x46 /* word64 MSB @fptr(S + A) */ -#define R_IA_64_FPTR64LSB 0x47 /* word64 LSB @fptr(S + A) */ -#define R_IA_64_PCREL60B 0x48 /* immediate60 form1 S + A - P */ -#define R_IA_64_PCREL21B 0x49 /* immediate21 form1 S + A - P */ -#define R_IA_64_PCREL21M 0x4a /* immediate21 form2 S + A - P */ -#define R_IA_64_PCREL21F 0x4b /* immediate21 form3 S + A - P */ -#define R_IA_64_PCREL32MSB 0x4c /* word32 MSB S + A - P */ -#define R_IA_64_PCREL32LSB 0x4d /* word32 LSB S + A - P */ -#define R_IA_64_PCREL64MSB 0x4e /* word64 MSB S + A - P */ -#define R_IA_64_PCREL64LSB 0x4f /* word64 LSB S + A - P */ -#define R_IA_64_LTOFF_FPTR22 0x52 /* immediate22 @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR64I 0x53 /* immediate64 @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR32MSB 0x54 /* word32 MSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR32LSB 0x55 /* word32 LSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR64MSB 0x56 /* word64 MSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR64LSB 0x57 /* word64 LSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_SEGREL32MSB 0x5c /* word32 MSB @segrel(S + A) */ -#define R_IA_64_SEGREL32LSB 0x5d /* word32 LSB @segrel(S + A) */ -#define R_IA_64_SEGREL64MSB 0x5e /* word64 MSB @segrel(S + A) */ -#define R_IA_64_SEGREL64LSB 0x5f /* word64 LSB @segrel(S + A) */ -#define R_IA_64_SECREL32MSB 0x64 /* word32 MSB @secrel(S + A) */ -#define R_IA_64_SECREL32LSB 0x65 /* word32 LSB @secrel(S + A) */ -#define R_IA_64_SECREL64MSB 0x66 /* word64 MSB @secrel(S + A) */ -#define R_IA_64_SECREL64LSB 0x67 /* word64 LSB @secrel(S + A) */ -#define R_IA_64_REL32MSB 0x6c /* word32 MSB BD + A */ -#define R_IA_64_REL32LSB 0x6d /* word32 LSB BD + A */ -#define R_IA_64_REL64MSB 0x6e /* word64 MSB BD + A */ -#define R_IA_64_REL64LSB 0x6f /* word64 LSB BD + A */ -#define R_IA_64_LTV32MSB 0x74 /* word32 MSB S + A */ -#define R_IA_64_LTV32LSB 0x75 /* word32 LSB S + A */ -#define R_IA_64_LTV64MSB 0x76 /* word64 MSB S + A */ -#define R_IA_64_LTV64LSB 0x77 /* word64 LSB S + A */ -#define R_IA_64_PCREL21BI 0x79 /* immediate21 form1 S + A - P */ -#define R_IA_64_PCREL22 0x7a /* immediate22 S + A - P */ -#define R_IA_64_PCREL64I 0x7b /* immediate64 S + A - P */ -#define R_IA_64_IPLTMSB 0x80 /* function descriptor MSB special */ -#define R_IA_64_IPLTLSB 0x81 /* function descriptor LSB speciaal */ -#define R_IA_64_SUB 0x85 /* immediate64 A - S */ -#define R_IA_64_LTOFF22X 0x86 /* immediate22 special */ -#define R_IA_64_LDXMOV 0x87 /* immediate22 special */ -#define R_IA_64_TPREL14 0x91 /* imm14 @tprel(S + A) */ -#define R_IA_64_TPREL22 0x92 /* imm22 @tprel(S + A) */ -#define R_IA_64_TPREL64I 0x93 /* imm64 @tprel(S + A) */ -#define R_IA_64_TPREL64MSB 0x96 /* word64 MSB @tprel(S + A) */ -#define R_IA_64_TPREL64LSB 0x97 /* word64 LSB @tprel(S + A) */ -#define R_IA_64_LTOFF_TPREL22 0x9a /* imm22 @ltoff(@tprel(S+A)) */ -#define R_IA_64_DTPMOD64MSB 0xa6 /* word64 MSB @dtpmod(S + A) */ -#define R_IA_64_DTPMOD64LSB 0xa7 /* word64 LSB @dtpmod(S + A) */ -#define R_IA_64_LTOFF_DTPMOD22 0xaa /* imm22 @ltoff(@dtpmod(S+A)) */ -#define R_IA_64_DTPREL14 0xb1 /* imm14 @dtprel(S + A) */ -#define R_IA_64_DTPREL22 0xb2 /* imm22 @dtprel(S + A) */ -#define R_IA_64_DTPREL64I 0xb3 /* imm64 @dtprel(S + A) */ -#define R_IA_64_DTPREL32MSB 0xb4 /* word32 MSB @dtprel(S + A) */ -#define R_IA_64_DTPREL32LSB 0xb5 /* word32 LSB @dtprel(S + A) */ -#define R_IA_64_DTPREL64MSB 0xb6 /* word64 MSB @dtprel(S + A) */ -#define R_IA_64_DTPREL64LSB 0xb7 /* word64 LSB @dtprel(S + A) */ -#define R_IA_64_LTOFF_DTPREL22 0xba /* imm22 @ltoff(@dtprel(S+A)) */ - -#define R_MIPS_NONE 0 /* No reloc */ -#define R_MIPS_16 1 /* Direct 16 bit */ -#define R_MIPS_32 2 /* Direct 32 bit */ -#define R_MIPS_REL32 3 /* PC relative 32 bit */ -#define R_MIPS_26 4 /* Direct 26 bit shifted */ -#define R_MIPS_HI16 5 /* High 16 bit */ -#define R_MIPS_LO16 6 /* Low 16 bit */ -#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ -#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ -#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ -#define R_MIPS_PC16 10 /* PC relative 16 bit */ -#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ -#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ -#define R_MIPS_GOTHI16 21 /* GOT HI 16 bit */ -#define R_MIPS_GOTLO16 22 /* GOT LO 16 bit */ -#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ -#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ - -#define R_PPC_NONE 0 /* No relocation. */ -#define R_PPC_ADDR32 1 -#define R_PPC_ADDR24 2 -#define R_PPC_ADDR16 3 -#define R_PPC_ADDR16_LO 4 -#define R_PPC_ADDR16_HI 5 -#define R_PPC_ADDR16_HA 6 -#define R_PPC_ADDR14 7 -#define R_PPC_ADDR14_BRTAKEN 8 -#define R_PPC_ADDR14_BRNTAKEN 9 -#define R_PPC_REL24 10 -#define R_PPC_REL14 11 -#define R_PPC_REL14_BRTAKEN 12 -#define R_PPC_REL14_BRNTAKEN 13 -#define R_PPC_GOT16 14 -#define R_PPC_GOT16_LO 15 -#define R_PPC_GOT16_HI 16 -#define R_PPC_GOT16_HA 17 -#define R_PPC_PLTREL24 18 -#define R_PPC_COPY 19 -#define R_PPC_GLOB_DAT 20 -#define R_PPC_JMP_SLOT 21 -#define R_PPC_RELATIVE 22 -#define R_PPC_LOCAL24PC 23 -#define R_PPC_UADDR32 24 -#define R_PPC_UADDR16 25 -#define R_PPC_REL32 26 -#define R_PPC_PLT32 27 -#define R_PPC_PLTREL32 28 -#define R_PPC_PLT16_LO 29 -#define R_PPC_PLT16_HI 30 -#define R_PPC_PLT16_HA 31 -#define R_PPC_SDAREL16 32 -#define R_PPC_SECTOFF 33 -#define R_PPC_SECTOFF_LO 34 -#define R_PPC_SECTOFF_HI 35 -#define R_PPC_SECTOFF_HA 36 - -/* - * TLS relocations - */ -#define R_PPC_TLS 67 -#define R_PPC_DTPMOD32 68 -#define R_PPC_TPREL16 69 -#define R_PPC_TPREL16_LO 70 -#define R_PPC_TPREL16_HI 71 -#define R_PPC_TPREL16_HA 72 -#define R_PPC_TPREL32 73 -#define R_PPC_DTPREL16 74 -#define R_PPC_DTPREL16_LO 75 -#define R_PPC_DTPREL16_HI 76 -#define R_PPC_DTPREL16_HA 77 -#define R_PPC_DTPREL32 78 -#define R_PPC_GOT_TLSGD16 79 -#define R_PPC_GOT_TLSGD16_LO 80 -#define R_PPC_GOT_TLSGD16_HI 81 -#define R_PPC_GOT_TLSGD16_HA 82 -#define R_PPC_GOT_TLSLD16 83 -#define R_PPC_GOT_TLSLD16_LO 84 -#define R_PPC_GOT_TLSLD16_HI 85 -#define R_PPC_GOT_TLSLD16_HA 86 -#define R_PPC_GOT_TPREL16 87 -#define R_PPC_GOT_TPREL16_LO 88 -#define R_PPC_GOT_TPREL16_HI 89 -#define R_PPC_GOT_TPREL16_HA 90 - -/* - * The remaining relocs are from the Embedded ELF ABI, and are not in the - * SVR4 ELF ABI. - */ - -#define R_PPC_EMB_NADDR32 101 -#define R_PPC_EMB_NADDR16 102 -#define R_PPC_EMB_NADDR16_LO 103 -#define R_PPC_EMB_NADDR16_HI 104 -#define R_PPC_EMB_NADDR16_HA 105 -#define R_PPC_EMB_SDAI16 106 -#define R_PPC_EMB_SDA2I16 107 -#define R_PPC_EMB_SDA2REL 108 -#define R_PPC_EMB_SDA21 109 -#define R_PPC_EMB_MRKREF 110 -#define R_PPC_EMB_RELSEC16 111 -#define R_PPC_EMB_RELST_LO 112 -#define R_PPC_EMB_RELST_HI 113 -#define R_PPC_EMB_RELST_HA 114 -#define R_PPC_EMB_BIT_FLD 115 -#define R_PPC_EMB_RELSDA 116 - -#define R_SPARC_NONE 0 -#define R_SPARC_8 1 -#define R_SPARC_16 2 -#define R_SPARC_32 3 -#define R_SPARC_DISP8 4 -#define R_SPARC_DISP16 5 -#define R_SPARC_DISP32 6 -#define R_SPARC_WDISP30 7 -#define R_SPARC_WDISP22 8 -#define R_SPARC_HI22 9 -#define R_SPARC_22 10 -#define R_SPARC_13 11 -#define R_SPARC_LO10 12 -#define R_SPARC_GOT10 13 -#define R_SPARC_GOT13 14 -#define R_SPARC_GOT22 15 -#define R_SPARC_PC10 16 -#define R_SPARC_PC22 17 -#define R_SPARC_WPLT30 18 -#define R_SPARC_COPY 19 -#define R_SPARC_GLOB_DAT 20 -#define R_SPARC_JMP_SLOT 21 -#define R_SPARC_RELATIVE 22 -#define R_SPARC_UA32 23 -#define R_SPARC_PLT32 24 -#define R_SPARC_HIPLT22 25 -#define R_SPARC_LOPLT10 26 -#define R_SPARC_PCPLT32 27 -#define R_SPARC_PCPLT22 28 -#define R_SPARC_PCPLT10 29 -#define R_SPARC_10 30 -#define R_SPARC_11 31 -#define R_SPARC_64 32 -#define R_SPARC_OLO10 33 -#define R_SPARC_HH22 34 -#define R_SPARC_HM10 35 -#define R_SPARC_LM22 36 -#define R_SPARC_PC_HH22 37 -#define R_SPARC_PC_HM10 38 -#define R_SPARC_PC_LM22 39 -#define R_SPARC_WDISP16 40 -#define R_SPARC_WDISP19 41 -#define R_SPARC_GLOB_JMP 42 -#define R_SPARC_7 43 -#define R_SPARC_5 44 -#define R_SPARC_6 45 -#define R_SPARC_DISP64 46 -#define R_SPARC_PLT64 47 -#define R_SPARC_HIX22 48 -#define R_SPARC_LOX10 49 -#define R_SPARC_H44 50 -#define R_SPARC_M44 51 -#define R_SPARC_L44 52 -#define R_SPARC_REGISTER 53 -#define R_SPARC_UA64 54 -#define R_SPARC_UA16 55 -#define R_SPARC_TLS_GD_HI22 56 -#define R_SPARC_TLS_GD_LO10 57 -#define R_SPARC_TLS_GD_ADD 58 -#define R_SPARC_TLS_GD_CALL 59 -#define R_SPARC_TLS_LDM_HI22 60 -#define R_SPARC_TLS_LDM_LO10 61 -#define R_SPARC_TLS_LDM_ADD 62 -#define R_SPARC_TLS_LDM_CALL 63 -#define R_SPARC_TLS_LDO_HIX22 64 -#define R_SPARC_TLS_LDO_LOX10 65 -#define R_SPARC_TLS_LDO_ADD 66 -#define R_SPARC_TLS_IE_HI22 67 -#define R_SPARC_TLS_IE_LO10 68 -#define R_SPARC_TLS_IE_LD 69 -#define R_SPARC_TLS_IE_LDX 70 -#define R_SPARC_TLS_IE_ADD 71 -#define R_SPARC_TLS_LE_HIX22 72 -#define R_SPARC_TLS_LE_LOX10 73 -#define R_SPARC_TLS_DTPMOD32 74 -#define R_SPARC_TLS_DTPMOD64 75 -#define R_SPARC_TLS_DTPOFF32 76 -#define R_SPARC_TLS_DTPOFF64 77 -#define R_SPARC_TLS_TPOFF32 78 -#define R_SPARC_TLS_TPOFF64 79 - -#define R_X86_64_NONE 0 /* No relocation. */ -#define R_X86_64_64 1 /* Add 64 bit symbol value. */ -#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */ -#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */ -#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */ -#define R_X86_64_COPY 5 /* Copy data from shared object. */ -#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */ -#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */ -#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */ -#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */ -#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */ -#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */ -#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ -#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ -#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ -#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ -#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ -#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */ -#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */ -#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */ -#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */ -#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ -#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ -#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ - - -#endif /* !_SYS_ELF_COMMON_H_ */ diff --git a/include/mingw/signal.h b/include/mingw/signal.h deleted file mode 100755 index 3d7f36d8..00000000 --- a/include/mingw/signal.h +++ /dev/null @@ -1,38 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name -#ifndef __MINGW_SIGNAL__ -#define __MINGW_SIGNAL__ - -#ifdef MINGW // Only for cross compilation to mingw - -// Posix is a superset of the ISO C signal.h -// include ISO C version first -#include_next -#include -#include - -#if defined(UNW_TARGET_X86_64) -# define SIZEOF_SIGINFO 128 -#elif defined(UNW_TARGET_ARM64) -# define SIZEOF_SIGINFO 128 -#elif defined(UNW_TARGET_ARM) -# define SIZEOF_SIGINFO 128 -#elif !defined(SIZEOF_SIGINFO) - // It is not clear whether the sizeof(siginfo_t) is important - // While compiling on Windows the members are not referenced... - // However the size maybe important during a case or a memcpy - // Barring a full audit it could be important so require the size to be defined -# error SIZEOF_SIGINFO is unknown for this target -#endif - -typedef struct siginfo -{ - uint8_t content[SIZEOF_SIGINFO]; -} siginfo_t; - -typedef long sigset_t; - -int sigfillset(sigset_t *set); - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/mingw/sys/mman.h b/include/mingw/sys/mman.h deleted file mode 100755 index fe05816d..00000000 --- a/include/mingw/sys/mman.h +++ /dev/null @@ -1,27 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name -#ifndef __MINGW_SYS_MMAN__ -#define __MINGW_SYS_MMAN__ - -#ifdef MINGW // Only for cross compilation to mingw - -#include - -#if !HAVE_MMAP - -#define MAP_FAILED (void *) -1 -#define MAP_ANONYMOUS 1 -#define MAP_ANON MAP_ANONYMOUS -#define MAP_PRIVATE 2 - -#define PROT_NONE 0 -#define PROT_READ 1 -#define PROT_WRITE 2 -#define PROT_EXEC 4 - -void* mmap(void *, size_t, int, int, int, size_t); -int munmap(void *, size_t); -#endif - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/mingw/sys/syscall.h b/include/mingw/sys/syscall.h deleted file mode 100755 index 3677ebdb..00000000 --- a/include/mingw/sys/syscall.h +++ /dev/null @@ -1,10 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name -#ifndef __MINGW_SYSCALL__ -#define __MINGW_SYSCALL__ - -#ifdef MINGW // Only for cross compilation to mingw - -#endif // MINGW - -#endif diff --git a/include/mingw/sys/ucontext.h b/include/mingw/sys/ucontext.h deleted file mode 100755 index 672051d7..00000000 --- a/include/mingw/sys/ucontext.h +++ /dev/null @@ -1,40 +0,0 @@ -// This is an incomplete & imprecice implementation of the *nix file -// by the same name -#ifndef __MINGW_SYS_UCONTEXT__ -#define __MINGW_SYS_UCONTEXT__ - -#ifdef MINGW // Only for cross compilation to mingw -#include - -#if defined(UNW_TARGET_X86_64) -# define SIZEOF_UCONTEXT 936 -#elif defined(UNW_TARGET_ARM64) -# define SIZEOF_UCONTEXT 4560 -#elif defined(UNW_TARGET_ARM) -# define SIZEOF_UCONTEXT 744 -#elif !defined(SIZEOF_UCONTEXT) - // It is not clear whether the sizeof(ucontext_t) is important - // While compiling on Windows the members are not referenced... - // However the size maybe important during a case or a memcpy - // Barring a full audit it could be important so require the size to be defined -# error SIZEOF_UCONTEXT is unknown for this target -#endif - -typedef struct ucontext -{ - uint8_t content[SIZEOF_UCONTEXT]; -} ucontext_t; - -#ifdef __aarch64__ -// These types are used in the definition of the aarch64 unw_tdep_context_t -// They are not used in UNW_REMOTE_ONLY, so typedef them as something -typedef long sigset_t; -typedef long stack_t; - -// Windows SDK defines reserved. It conflicts with arm64 ucontext -// Undefine it -#undef __reserved -#endif - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/mingw/ucontext.h b/include/mingw/ucontext.h deleted file mode 100755 index a1646aae..00000000 --- a/include/mingw/ucontext.h +++ /dev/null @@ -1,11 +0,0 @@ -// This is an incomplete & imprecice implementation of the *nix file -// by the same name -#ifndef __MINGW_UCONTEXT__ -#define __MINGW_UCONTEXT__ - -#ifdef MINGW // Only for cross compilation to mingw - -#include - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/mingw/unistd.h b/include/mingw/unistd.h deleted file mode 100755 index 1b29689e..00000000 --- a/include/mingw/unistd.h +++ /dev/null @@ -1,34 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - -#ifndef __MINGW_UNISTD__ -#define __MINGW_UNISTD__ - -#ifdef MINGW // Only for cross compilation to mingw - -#include - -#ifndef UNW_REMOTE_ONLY -// This is solely intended to enable compilation of libunwind -// for UNW_REMOTE_ONLY on windows -#error Cross compilation of libunwind on Windows can only support UNW_REMOTE_ONLY -#endif - -#include -#include -#include -#include - - -int getpagesize(void); -// mingw have these -// int close(int); -// int open(const char *, int, ...); -// ssize_t read(int fd, void *buf, size_t count); -// ssize_t write(int, const void *, size_t); - -// read write is here -#include - -#endif // MINGW -#endif \ No newline at end of file diff --git a/include/ohos-config.h b/include/ohos-config.h deleted file mode 100644 index 8b30a9f8..00000000 --- a/include/ohos-config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* This file contains header file for ohos config */ - -#ifndef OHOS_CONFIG_H -#define OHOS_CONFIG_H - -int config_unwi_debug_level(void); - -#endif diff --git a/include/win/elf.h b/include/win/elf.h deleted file mode 100644 index 5089ff6b..00000000 --- a/include/win/elf.h +++ /dev/null @@ -1,16 +0,0 @@ -// This is an incomplete & imprecice implementation -// It defers to the open source freebsd-elf implementations. - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -#include - -#include "freebsd-elf_common.h" -#include "freebsd-elf32.h" -#include "freebsd-elf64.h" - -#endif // _MSC_VER diff --git a/include/win/endian.h b/include/win/endian.h deleted file mode 100644 index 56fb68a7..00000000 --- a/include/win/endian.h +++ /dev/null @@ -1,16 +0,0 @@ -// This is an incomplete & imprecice implementation of the -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 - -#define __BYTE_ORDER __LITTLE_ENDIAN - -#endif // _MSC_VER diff --git a/include/win/fakestdalign.h.in b/include/win/fakestdalign.h.in deleted file mode 100644 index 6eb292c9..00000000 --- a/include/win/fakestdalign.h.in +++ /dev/null @@ -1,9 +0,0 @@ -// This is a fake implementation of stdalign.h for when -// compiler C11 stdaliagn.h support is missing - -#ifndef FAKE_STD_ALIGN_H -#define FAKE_STD_ALIGN_H - -#define alignas(x) - -#endif // FAKE_STD_ALIGN_H diff --git a/include/win/fakestdatomic.h.in b/include/win/fakestdatomic.h.in deleted file mode 100644 index 48cde832..00000000 --- a/include/win/fakestdatomic.h.in +++ /dev/null @@ -1,36 +0,0 @@ -// This is a non-atomic fake implementation of stdatomic.h for when -// compiler C11 stdatomic support is missing and only single threaded -// operation is required - -#ifndef FAKE_STD_ATOMICS_H -#define FAKE_STD_ATOMICS_H - -#include - -#define _Atomic volatile -#define ATOMIC_FLAG_INIT 0 - -typedef uint8_t atomic_bool; -typedef uint8_t atomic_flag; - -#define atomic_compare_and_exchange_strong(x, y, z) return ((*(x) == *(y)) ? ((*(x) = z), true) : ((*(y) = *(x)),false)) - -#define atomic_fetch_add(x, y) *(x) += (y), (*(x) - (y)) - -static inline void atomic_flag_clear(volatile atomic_flag* flag) -{ - *flag = ATOMIC_FLAG_INIT; -} - -static inline atomic_bool atomic_flag_test_and_set( volatile atomic_flag* flag ) -{ - atomic_bool result = *flag; - *flag = 1; - return result; -} - -#define atomic_load(x) (*(x)) -#define atomic_store(x, y) do { *(x) = (y); } while (0) - - -#endif // FAKE_STD_ATOMICS_H diff --git a/include/win/freebsd-elf32.h b/include/win/freebsd-elf32.h deleted file mode 100644 index b4c0d942..00000000 --- a/include/win/freebsd-elf32.h +++ /dev/null @@ -1,245 +0,0 @@ -/*- - * Copyright (c) 1996-1998 John D. Polstra. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $ - */ - -#ifndef _SYS_ELF32_H_ -#define _SYS_ELF32_H_ 1 - -#include "freebsd-elf_common.h" - -/* - * ELF definitions common to all 32-bit architectures. - */ - -typedef uint32_t Elf32_Addr; -typedef uint16_t Elf32_Half; -typedef uint32_t Elf32_Off; -typedef int32_t Elf32_Sword; -typedef uint32_t Elf32_Word; -typedef uint64_t Elf32_Lword; - -typedef Elf32_Word Elf32_Hashelt; - -/* Non-standard class-dependent datatype used for abstraction. */ -typedef Elf32_Word Elf32_Size; -typedef Elf32_Sword Elf32_Ssize; - -/* - * ELF header. - */ - -typedef struct { - unsigned char e_ident[EI_NIDENT]; /* File identification. */ - Elf32_Half e_type; /* File type. */ - Elf32_Half e_machine; /* Machine architecture. */ - Elf32_Word e_version; /* ELF format version. */ - Elf32_Addr e_entry; /* Entry point. */ - Elf32_Off e_phoff; /* Program header file offset. */ - Elf32_Off e_shoff; /* Section header file offset. */ - Elf32_Word e_flags; /* Architecture-specific flags. */ - Elf32_Half e_ehsize; /* Size of ELF header in bytes. */ - Elf32_Half e_phentsize; /* Size of program header entry. */ - Elf32_Half e_phnum; /* Number of program header entries. */ - Elf32_Half e_shentsize; /* Size of section header entry. */ - Elf32_Half e_shnum; /* Number of section header entries. */ - Elf32_Half e_shstrndx; /* Section name strings section. */ -} Elf32_Ehdr; - -/* - * Section header. - */ - -typedef struct { - Elf32_Word sh_name; /* Section name (index into the - section header string table). */ - Elf32_Word sh_type; /* Section type. */ - Elf32_Word sh_flags; /* Section flags. */ - Elf32_Addr sh_addr; /* Address in memory image. */ - Elf32_Off sh_offset; /* Offset in file. */ - Elf32_Word sh_size; /* Size in bytes. */ - Elf32_Word sh_link; /* Index of a related section. */ - Elf32_Word sh_info; /* Depends on section type. */ - Elf32_Word sh_addralign; /* Alignment in bytes. */ - Elf32_Word sh_entsize; /* Size of each entry in section. */ -} Elf32_Shdr; - -/* - * Program header. - */ - -typedef struct { - Elf32_Word p_type; /* Entry type. */ - Elf32_Off p_offset; /* File offset of contents. */ - Elf32_Addr p_vaddr; /* Virtual address in memory image. */ - Elf32_Addr p_paddr; /* Physical address (not used). */ - Elf32_Word p_filesz; /* Size of contents in file. */ - Elf32_Word p_memsz; /* Size of contents in memory. */ - Elf32_Word p_flags; /* Access permission flags. */ - Elf32_Word p_align; /* Alignment in memory and file. */ -} Elf32_Phdr; - -/* - * Dynamic structure. The ".dynamic" section contains an array of them. - */ - -typedef struct { - Elf32_Sword d_tag; /* Entry type. */ - union { - Elf32_Word d_val; /* Integer value. */ - Elf32_Addr d_ptr; /* Address value. */ - } d_un; -} Elf32_Dyn; - -/* - * Relocation entries. - */ - -/* Relocations that don't need an addend field. */ -typedef struct { - Elf32_Addr r_offset; /* Location to be relocated. */ - Elf32_Word r_info; /* Relocation type and symbol index. */ -} Elf32_Rel; - -/* Relocations that need an addend field. */ -typedef struct { - Elf32_Addr r_offset; /* Location to be relocated. */ - Elf32_Word r_info; /* Relocation type and symbol index. */ - Elf32_Sword r_addend; /* Addend. */ -} Elf32_Rela; - -/* Macros for accessing the fields of r_info. */ -#define ELF32_R_SYM(info) ((info) >> 8) -#define ELF32_R_TYPE(info) ((unsigned char)(info)) - -/* Macro for constructing r_info from field values. */ -#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) - -/* - * Note entry header - */ -typedef Elf_Note Elf32_Nhdr; - -/* - * Move entry - */ -typedef struct { - Elf32_Lword m_value; /* symbol value */ - Elf32_Word m_info; /* size + index */ - Elf32_Word m_poffset; /* symbol offset */ - Elf32_Half m_repeat; /* repeat count */ - Elf32_Half m_stride; /* stride info */ -} Elf32_Move; - -/* - * The macros compose and decompose values for Move.r_info - * - * sym = ELF32_M_SYM(M.m_info) - * size = ELF32_M_SIZE(M.m_info) - * M.m_info = ELF32_M_INFO(sym, size) - */ -#define ELF32_M_SYM(info) ((info)>>8) -#define ELF32_M_SIZE(info) ((unsigned char)(info)) -#define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) - -/* - * Hardware/Software capabilities entry - */ -typedef struct { - Elf32_Word c_tag; /* how to interpret value */ - union { - Elf32_Word c_val; - Elf32_Addr c_ptr; - } c_un; -} Elf32_Cap; - -/* - * Symbol table entries. - */ - -typedef struct { - Elf32_Word st_name; /* String table index of name. */ - Elf32_Addr st_value; /* Symbol value. */ - Elf32_Word st_size; /* Size of associated object. */ - unsigned char st_info; /* Type and binding information. */ - unsigned char st_other; /* Reserved (not used). */ - Elf32_Half st_shndx; /* Section index of symbol. */ -} Elf32_Sym; - -/* Macros for accessing the fields of st_info. */ -#define ELF32_ST_BIND(info) ((info) >> 4) -#define ELF32_ST_TYPE(info) ((info) & 0xf) - -/* Macro for constructing st_info from field values. */ -#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) - -/* Macro for accessing the fields of st_other. */ -#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3) - -/* Structures used by Sun & GNU symbol versioning. */ -typedef struct -{ - Elf32_Half vd_version; - Elf32_Half vd_flags; - Elf32_Half vd_ndx; - Elf32_Half vd_cnt; - Elf32_Word vd_hash; - Elf32_Word vd_aux; - Elf32_Word vd_next; -} Elf32_Verdef; - -typedef struct -{ - Elf32_Word vda_name; - Elf32_Word vda_next; -} Elf32_Verdaux; - -typedef struct -{ - Elf32_Half vn_version; - Elf32_Half vn_cnt; - Elf32_Word vn_file; - Elf32_Word vn_aux; - Elf32_Word vn_next; -} Elf32_Verneed; - -typedef struct -{ - Elf32_Word vna_hash; - Elf32_Half vna_flags; - Elf32_Half vna_other; - Elf32_Word vna_name; - Elf32_Word vna_next; -} Elf32_Vernaux; - -typedef Elf32_Half Elf32_Versym; - -typedef struct { - Elf32_Half si_boundto; /* direct bindings - symbol bound to */ - Elf32_Half si_flags; /* per symbol flags */ -} Elf32_Syminfo; - -#endif /* !_SYS_ELF32_H_ */ diff --git a/include/win/freebsd-elf64.h b/include/win/freebsd-elf64.h deleted file mode 100644 index 0991fe35..00000000 --- a/include/win/freebsd-elf64.h +++ /dev/null @@ -1,252 +0,0 @@ -/*- - * Copyright (c) 1996-1998 John D. Polstra. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $ - */ - -#ifndef _SYS_ELF64_H_ -#define _SYS_ELF64_H_ 1 - -#include "freebsd-elf_common.h" - -/* - * ELF definitions common to all 64-bit architectures. - */ - -typedef uint64_t Elf64_Addr; -typedef uint16_t Elf64_Half; -typedef uint64_t Elf64_Off; -typedef int32_t Elf64_Sword; -typedef int64_t Elf64_Sxword; -typedef uint32_t Elf64_Word; -typedef uint64_t Elf64_Lword; -typedef uint64_t Elf64_Xword; - -/* - * Types of dynamic symbol hash table bucket and chain elements. - * - * This is inconsistent among 64 bit architectures, so a machine dependent - * typedef is required. - */ - -#ifdef __alpha__ -typedef Elf64_Off Elf64_Hashelt; -#else -typedef Elf64_Word Elf64_Hashelt; -#endif - -/* Non-standard class-dependent datatype used for abstraction. */ -typedef Elf64_Xword Elf64_Size; -typedef Elf64_Sxword Elf64_Ssize; - -/* - * ELF header. - */ - -typedef struct { - unsigned char e_ident[EI_NIDENT]; /* File identification. */ - Elf64_Half e_type; /* File type. */ - Elf64_Half e_machine; /* Machine architecture. */ - Elf64_Word e_version; /* ELF format version. */ - Elf64_Addr e_entry; /* Entry point. */ - Elf64_Off e_phoff; /* Program header file offset. */ - Elf64_Off e_shoff; /* Section header file offset. */ - Elf64_Word e_flags; /* Architecture-specific flags. */ - Elf64_Half e_ehsize; /* Size of ELF header in bytes. */ - Elf64_Half e_phentsize; /* Size of program header entry. */ - Elf64_Half e_phnum; /* Number of program header entries. */ - Elf64_Half e_shentsize; /* Size of section header entry. */ - Elf64_Half e_shnum; /* Number of section header entries. */ - Elf64_Half e_shstrndx; /* Section name strings section. */ -} Elf64_Ehdr; - -/* - * Section header. - */ - -typedef struct { - Elf64_Word sh_name; /* Section name (index into the - section header string table). */ - Elf64_Word sh_type; /* Section type. */ - Elf64_Xword sh_flags; /* Section flags. */ - Elf64_Addr sh_addr; /* Address in memory image. */ - Elf64_Off sh_offset; /* Offset in file. */ - Elf64_Xword sh_size; /* Size in bytes. */ - Elf64_Word sh_link; /* Index of a related section. */ - Elf64_Word sh_info; /* Depends on section type. */ - Elf64_Xword sh_addralign; /* Alignment in bytes. */ - Elf64_Xword sh_entsize; /* Size of each entry in section. */ -} Elf64_Shdr; - -/* - * Program header. - */ - -typedef struct { - Elf64_Word p_type; /* Entry type. */ - Elf64_Word p_flags; /* Access permission flags. */ - Elf64_Off p_offset; /* File offset of contents. */ - Elf64_Addr p_vaddr; /* Virtual address in memory image. */ - Elf64_Addr p_paddr; /* Physical address (not used). */ - Elf64_Xword p_filesz; /* Size of contents in file. */ - Elf64_Xword p_memsz; /* Size of contents in memory. */ - Elf64_Xword p_align; /* Alignment in memory and file. */ -} Elf64_Phdr; - -/* - * Dynamic structure. The ".dynamic" section contains an array of them. - */ - -typedef struct { - Elf64_Sxword d_tag; /* Entry type. */ - union { - Elf64_Xword d_val; /* Integer value. */ - Elf64_Addr d_ptr; /* Address value. */ - } d_un; -} Elf64_Dyn; - -/* - * Relocation entries. - */ - -/* Relocations that don't need an addend field. */ -typedef struct { - Elf64_Addr r_offset; /* Location to be relocated. */ - Elf64_Xword r_info; /* Relocation type and symbol index. */ -} Elf64_Rel; - -/* Relocations that need an addend field. */ -typedef struct { - Elf64_Addr r_offset; /* Location to be relocated. */ - Elf64_Xword r_info; /* Relocation type and symbol index. */ - Elf64_Sxword r_addend; /* Addend. */ -} Elf64_Rela; - -/* Macros for accessing the fields of r_info. */ -#define ELF64_R_SYM(info) ((info) >> 32) -#define ELF64_R_TYPE(info) ((info) & 0xffffffffL) - -/* Macro for constructing r_info from field values. */ -#define ELF64_R_INFO(sym, type) (((sym) << 32) + ((type) & 0xffffffffL)) - -#define ELF64_R_TYPE_DATA(info) (((Elf64_Xword)(info)<<32)>>40) -#define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56) -#define ELF64_R_TYPE_INFO(data, type) \ - (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type)) - -/* - * Note entry header - */ -typedef Elf_Note Elf64_Nhdr; - -/* - * Move entry - */ -typedef struct { - Elf64_Lword m_value; /* symbol value */ - Elf64_Xword m_info; /* size + index */ - Elf64_Xword m_poffset; /* symbol offset */ - Elf64_Half m_repeat; /* repeat count */ - Elf64_Half m_stride; /* stride info */ -} Elf64_Move; - -#define ELF64_M_SYM(info) ((info)>>8) -#define ELF64_M_SIZE(info) ((unsigned char)(info)) -#define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) - -/* - * Hardware/Software capabilities entry - */ -typedef struct { - Elf64_Xword c_tag; /* how to interpret value */ - union { - Elf64_Xword c_val; - Elf64_Addr c_ptr; - } c_un; -} Elf64_Cap; - -/* - * Symbol table entries. - */ - -typedef struct { - Elf64_Word st_name; /* String table index of name. */ - unsigned char st_info; /* Type and binding information. */ - unsigned char st_other; /* Reserved (not used). */ - Elf64_Half st_shndx; /* Section index of symbol. */ - Elf64_Addr st_value; /* Symbol value. */ - Elf64_Xword st_size; /* Size of associated object. */ -} Elf64_Sym; - -/* Macros for accessing the fields of st_info. */ -#define ELF64_ST_BIND(info) ((info) >> 4) -#define ELF64_ST_TYPE(info) ((info) & 0xf) - -/* Macro for constructing st_info from field values. */ -#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) - -/* Macro for accessing the fields of st_other. */ -#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3) - -/* Structures used by Sun & GNU-style symbol versioning. */ -typedef struct { - Elf64_Half vd_version; - Elf64_Half vd_flags; - Elf64_Half vd_ndx; - Elf64_Half vd_cnt; - Elf64_Word vd_hash; - Elf64_Word vd_aux; - Elf64_Word vd_next; -} Elf64_Verdef; - -typedef struct { - Elf64_Word vda_name; - Elf64_Word vda_next; -} Elf64_Verdaux; - -typedef struct { - Elf64_Half vn_version; - Elf64_Half vn_cnt; - Elf64_Word vn_file; - Elf64_Word vn_aux; - Elf64_Word vn_next; -} Elf64_Verneed; - -typedef struct { - Elf64_Word vna_hash; - Elf64_Half vna_flags; - Elf64_Half vna_other; - Elf64_Word vna_name; - Elf64_Word vna_next; -} Elf64_Vernaux; - -typedef Elf64_Half Elf64_Versym; - -typedef struct { - Elf64_Half si_boundto; /* direct bindings - symbol bound to */ - Elf64_Half si_flags; /* per symbol flags */ -} Elf64_Syminfo; - -#endif /* !_SYS_ELF64_H_ */ diff --git a/include/win/freebsd-elf_common.h b/include/win/freebsd-elf_common.h deleted file mode 100644 index 7aef2d49..00000000 --- a/include/win/freebsd-elf_common.h +++ /dev/null @@ -1,865 +0,0 @@ -/*- - * Copyright (c) 1998 John D. Polstra. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/elf_common.h,v 1.24 2008/08/02 01:20:10 imp Exp $ - */ - -#ifndef _SYS_ELF_COMMON_H_ -#define _SYS_ELF_COMMON_H_ 1 - -/* - * ELF definitions that are independent of architecture or word size. - */ - -/* - * Note header. The ".note" section contains an array of notes. Each - * begins with this header, aligned to a word boundary. Immediately - * following the note header is n_namesz bytes of name, padded to the - * next word boundary. Then comes n_descsz bytes of descriptor, again - * padded to a word boundary. The values of n_namesz and n_descsz do - * not include the padding. - */ - -typedef struct { - uint32_t n_namesz; /* Length of name. */ - uint32_t n_descsz; /* Length of descriptor. */ - uint32_t n_type; /* Type of this note. */ -} Elf_Note; - -/* Indexes into the e_ident array. Keep synced with - http://www.sco.com/developers/gabi/latest/ch4.eheader.html */ -#define EI_MAG0 0 /* Magic number, byte 0. */ -#define EI_MAG1 1 /* Magic number, byte 1. */ -#define EI_MAG2 2 /* Magic number, byte 2. */ -#define EI_MAG3 3 /* Magic number, byte 3. */ -#define EI_CLASS 4 /* Class of machine. */ -#define EI_DATA 5 /* Data format. */ -#define EI_VERSION 6 /* ELF format version. */ -#define EI_OSABI 7 /* Operating system / ABI identification */ -#define EI_ABIVERSION 8 /* ABI version */ -#define OLD_EI_BRAND 8 /* Start of architecture identification. */ -#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ -#define EI_NIDENT 16 /* Size of e_ident array. */ - -/* Values for the magic number bytes. */ -#define ELFMAG0 0x7f -#define ELFMAG1 'E' -#define ELFMAG2 'L' -#define ELFMAG3 'F' -#define ELFMAG "\177ELF" /* magic string */ -#define SELFMAG 4 /* magic string size */ - -/* Values for e_ident[EI_VERSION] and e_version. */ -#define EV_NONE 0 -#define EV_CURRENT 1 - -/* Values for e_ident[EI_CLASS]. */ -#define ELFCLASSNONE 0 /* Unknown class. */ -#define ELFCLASS32 1 /* 32-bit architecture. */ -#define ELFCLASS64 2 /* 64-bit architecture. */ - -/* Values for e_ident[EI_DATA]. */ -#define ELFDATANONE 0 /* Unknown data format. */ -#define ELFDATA2LSB 1 /* 2's complement little-endian. */ -#define ELFDATA2MSB 2 /* 2's complement big-endian. */ - -/* Values for e_ident[EI_OSABI]. */ -#define ELFOSABI_NONE 0 /* UNIX System V ABI */ -#define ELFOSABI_HPUX 1 /* HP-UX operating system */ -#define ELFOSABI_NETBSD 2 /* NetBSD */ -#define ELFOSABI_LINUX 3 /* GNU/Linux */ -#define ELFOSABI_HURD 4 /* GNU/Hurd */ -#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ -#define ELFOSABI_SOLARIS 6 /* Solaris */ -#define ELFOSABI_AIX 7 /* AIX */ -#define ELFOSABI_IRIX 8 /* IRIX */ -#define ELFOSABI_FREEBSD 9 /* FreeBSD */ -#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ -#define ELFOSABI_MODESTO 11 /* Novell Modesto */ -#define ELFOSABI_OPENBSD 12 /* OpenBSD */ -#define ELFOSABI_OPENVMS 13 /* Open VMS */ -#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ -#define ELFOSABI_ARM 97 /* ARM */ -#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ - -#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */ -#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */ - -/* e_ident */ -#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ - (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ - (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ - (ehdr).e_ident[EI_MAG3] == ELFMAG3) - -/* Values for e_type. */ -#define ET_NONE 0 /* Unknown type. */ -#define ET_REL 1 /* Relocatable. */ -#define ET_EXEC 2 /* Executable. */ -#define ET_DYN 3 /* Shared object. */ -#define ET_CORE 4 /* Core file. */ -#define ET_LOOS 0xfe00 /* First operating system specific. */ -#define ET_HIOS 0xfeff /* Last operating system-specific. */ -#define ET_LOPROC 0xff00 /* First processor-specific. */ -#define ET_HIPROC 0xffff /* Last processor-specific. */ - -/* Values for e_machine. */ -#define EM_NONE 0 /* Unknown machine. */ -#define EM_M32 1 /* AT&T WE32100. */ -#define EM_SPARC 2 /* Sun SPARC. */ -#define EM_386 3 /* Intel i386. */ -#define EM_68K 4 /* Motorola 68000. */ -#define EM_88K 5 /* Motorola 88000. */ -#define EM_860 7 /* Intel i860. */ -#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */ -#define EM_S370 9 /* IBM System/370. */ -#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */ -#define EM_PARISC 15 /* HP PA-RISC. */ -#define EM_VPP500 17 /* Fujitsu VPP500. */ -#define EM_SPARC32PLUS 18 /* SPARC v8plus. */ -#define EM_960 19 /* Intel 80960. */ -#define EM_PPC 20 /* PowerPC 32-bit. */ -#define EM_PPC64 21 /* PowerPC 64-bit. */ -#define EM_S390 22 /* IBM System/390. */ -#define EM_V800 36 /* NEC V800. */ -#define EM_FR20 37 /* Fujitsu FR20. */ -#define EM_RH32 38 /* TRW RH-32. */ -#define EM_RCE 39 /* Motorola RCE. */ -#define EM_ARM 40 /* ARM. */ -#define EM_SH 42 /* Hitachi SH. */ -#define EM_SPARCV9 43 /* SPARC v9 64-bit. */ -#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */ -#define EM_ARC 45 /* Argonaut RISC Core. */ -#define EM_H8_300 46 /* Hitachi H8/300. */ -#define EM_H8_300H 47 /* Hitachi H8/300H. */ -#define EM_H8S 48 /* Hitachi H8S. */ -#define EM_H8_500 49 /* Hitachi H8/500. */ -#define EM_IA_64 50 /* Intel IA-64 Processor. */ -#define EM_MIPS_X 51 /* Stanford MIPS-X. */ -#define EM_COLDFIRE 52 /* Motorola ColdFire. */ -#define EM_68HC12 53 /* Motorola M68HC12. */ -#define EM_MMA 54 /* Fujitsu MMA. */ -#define EM_PCP 55 /* Siemens PCP. */ -#define EM_NCPU 56 /* Sony nCPU. */ -#define EM_NDR1 57 /* Denso NDR1 microprocessor. */ -#define EM_STARCORE 58 /* Motorola Star*Core processor. */ -#define EM_ME16 59 /* Toyota ME16 processor. */ -#define EM_ST100 60 /* STMicroelectronics ST100 processor. */ -#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ -#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ -#define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */ - -/* Non-standard or deprecated. */ -#define EM_486 6 /* Intel i486. */ -#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ -#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */ -#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */ - -/* Special section indexes. */ -#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ -#define SHN_LORESERVE 0xff00 /* First of reserved range. */ -#define SHN_LOPROC 0xff00 /* First processor-specific. */ -#define SHN_HIPROC 0xff1f /* Last processor-specific. */ -#define SHN_LOOS 0xff20 /* First operating system-specific. */ -#define SHN_HIOS 0xff3f /* Last operating system-specific. */ -#define SHN_ABS 0xfff1 /* Absolute values. */ -#define SHN_COMMON 0xfff2 /* Common data. */ -#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */ -#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ - -/* sh_type */ -#define SHT_NULL 0 /* inactive */ -#define SHT_PROGBITS 1 /* program defined information */ -#define SHT_SYMTAB 2 /* symbol table section */ -#define SHT_STRTAB 3 /* string table section */ -#define SHT_RELA 4 /* relocation section with addends */ -#define SHT_HASH 5 /* symbol hash table section */ -#define SHT_DYNAMIC 6 /* dynamic section */ -#define SHT_NOTE 7 /* note section */ -#define SHT_NOBITS 8 /* no space section */ -#define SHT_REL 9 /* relocation section - no addends */ -#define SHT_SHLIB 10 /* reserved - purpose unknown */ -#define SHT_DYNSYM 11 /* dynamic symbol table section */ -#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ -#define SHT_FINI_ARRAY 15 /* Termination function pointers. */ -#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ -#define SHT_GROUP 17 /* Section group. */ -#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */ -#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ -#define SHT_LOSUNW 0x6ffffff4 -#define SHT_SUNW_dof 0x6ffffff4 -#define SHT_SUNW_cap 0x6ffffff5 -#define SHT_SUNW_SIGNATURE 0x6ffffff6 -#define SHT_SUNW_ANNOTATE 0x6ffffff7 -#define SHT_SUNW_DEBUGSTR 0x6ffffff8 -#define SHT_SUNW_DEBUG 0x6ffffff9 -#define SHT_SUNW_move 0x6ffffffa -#define SHT_SUNW_COMDAT 0x6ffffffb -#define SHT_SUNW_syminfo 0x6ffffffc -#define SHT_SUNW_verdef 0x6ffffffd -#define SHT_GNU_verdef 0x6ffffffd /* Symbol versions provided */ -#define SHT_SUNW_verneed 0x6ffffffe -#define SHT_GNU_verneed 0x6ffffffe /* Symbol versions required */ -#define SHT_SUNW_versym 0x6fffffff -#define SHT_GNU_versym 0x6fffffff /* Symbol version table */ -#define SHT_HISUNW 0x6fffffff -#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ -#define SHT_LOPROC 0x70000000 /* reserved range for processor */ -#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ -#define SHT_HIPROC 0x7fffffff /* specific section header types */ -#define SHT_LOUSER 0x80000000 /* reserved range for application */ -#define SHT_HIUSER 0xffffffff /* specific indexes */ - -/* Flags for sh_flags. */ -#define SHF_WRITE 0x1 /* Section contains writable data. */ -#define SHF_ALLOC 0x2 /* Section occupies memory. */ -#define SHF_EXECINSTR 0x4 /* Section contains instructions. */ -#define SHF_MERGE 0x10 /* Section may be merged. */ -#define SHF_STRINGS 0x20 /* Section contains strings. */ -#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */ -#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */ -#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ -#define SHF_GROUP 0x200 /* Member of section group. */ -#define SHF_TLS 0x400 /* Section contains TLS data. */ -#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ -#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ - -/* Values for p_type. */ -#define PT_NULL 0 /* Unused entry. */ -#define PT_LOAD 1 /* Loadable segment. */ -#define PT_DYNAMIC 2 /* Dynamic linking information segment. */ -#define PT_INTERP 3 /* Pathname of interpreter. */ -#define PT_NOTE 4 /* Auxiliary information. */ -#define PT_SHLIB 5 /* Reserved (not used). */ -#define PT_PHDR 6 /* Location of program header itself. */ -#define PT_TLS 7 /* Thread local storage segment */ -#define PT_LOOS 0x60000000 /* First OS-specific. */ -#define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */ -#define PT_GNU_EH_FRAME 0x6474e550 -#define PT_GNU_STACK 0x6474e551 -#define PT_LOSUNW 0x6ffffffa -#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ -#define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ -#define PT_SUNWDTRACE 0x6ffffffc /* private */ -#define PT_SUNWCAP 0x6ffffffd /* hard/soft capabilities segment */ -#define PT_HISUNW 0x6fffffff -#define PT_HIOS 0x6fffffff /* Last OS-specific. */ -#define PT_LOPROC 0x70000000 /* First processor-specific type. */ -#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ - -/* Values for p_flags. */ -#define PF_X 0x1 /* Executable. */ -#define PF_W 0x2 /* Writable. */ -#define PF_R 0x4 /* Readable. */ -#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */ -#define PF_MASKPROC 0xf0000000 /* Processor-specific. */ - -/* Extended program header index. */ -#define PN_XNUM 0xffff - -/* Values for d_tag. */ -#define DT_NULL 0 /* Terminating entry. */ -#define DT_NEEDED 1 /* String table offset of a needed shared - library. */ -#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */ -#define DT_PLTGOT 3 /* Processor-dependent address. */ -#define DT_HASH 4 /* Address of symbol hash table. */ -#define DT_STRTAB 5 /* Address of string table. */ -#define DT_SYMTAB 6 /* Address of symbol table. */ -#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ -#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ -#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ -#define DT_STRSZ 10 /* Size of string table. */ -#define DT_SYMENT 11 /* Size of each symbol table entry. */ -#define DT_INIT 12 /* Address of initialization function. */ -#define DT_FINI 13 /* Address of finalization function. */ -#define DT_SONAME 14 /* String table offset of shared object - name. */ -#define DT_RPATH 15 /* String table offset of library path. [sup] */ -#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */ -#define DT_REL 17 /* Address of ElfNN_Rel relocations. */ -#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */ -#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */ -#define DT_PLTREL 20 /* Type of relocation used for PLT. */ -#define DT_DEBUG 21 /* Reserved (not used). */ -#define DT_TEXTREL 22 /* Indicates there may be relocations in - non-writable segments. [sup] */ -#define DT_JMPREL 23 /* Address of PLT relocations. */ -#define DT_BIND_NOW 24 /* [sup] */ -#define DT_INIT_ARRAY 25 /* Address of the array of pointers to - initialization functions */ -#define DT_FINI_ARRAY 26 /* Address of the array of pointers to - termination functions */ -#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of - initialization functions. */ -#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of - terminationfunctions. */ -#define DT_RUNPATH 29 /* String table offset of a null-terminated - library search path string. */ -#define DT_FLAGS 30 /* Object specific flag values. */ -#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING - and less than DT_LOOS follow the rules for - the interpretation of the d_un union - as follows: even == 'd_ptr', even == 'd_val' - or none */ -#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to - pre-initialization functions. */ -#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of - pre-initialization functions. */ -#define DT_MAXPOSTAGS 34 /* number of positive tags */ -#define DT_LOOS 0x6000000d /* First OS-specific */ -#define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */ -#define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */ -#define DT_SUNW_FILTER 0x6000000f /* symbol filter name */ -#define DT_SUNW_CAP 0x60000010 /* hardware/software */ -#define DT_HIOS 0x6ffff000 /* Last OS-specific */ - -/* - * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the - * Dyn.d_un.d_val field of the Elf*_Dyn structure. - */ -#define DT_VALRNGLO 0x6ffffd00 -#define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */ -#define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */ -#define DT_MOVEENT 0x6ffffdfa /* move table entry size */ -#define DT_MOVESZ 0x6ffffdfb /* move table size */ -#define DT_FEATURE_1 0x6ffffdfc /* feature holder */ -#define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */ - /* the following DT_* entry. */ - /* See DF_P1_* definitions */ -#define DT_SYMINSZ 0x6ffffdfe /* syminfo table size (in bytes) */ -#define DT_SYMINENT 0x6ffffdff /* syminfo entry size (in bytes) */ -#define DT_VALRNGHI 0x6ffffdff - -/* - * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the - * Dyn.d_un.d_ptr field of the Elf*_Dyn structure. - * - * If any adjustment is made to the ELF object after it has been - * built, these entries will need to be adjusted. - */ -#define DT_ADDRRNGLO 0x6ffffe00 -#define DT_CONFIG 0x6ffffefa /* configuration information */ -#define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */ -#define DT_AUDIT 0x6ffffefc /* object auditing */ -#define DT_PLTPAD 0x6ffffefd /* pltpadding (sparcv9) */ -#define DT_MOVETAB 0x6ffffefe /* move table */ -#define DT_SYMINFO 0x6ffffeff /* syminfo table */ -#define DT_ADDRRNGHI 0x6ffffeff - -#define DT_VERSYM 0x6ffffff0 /* Address of versym section. */ -#define DT_RELACOUNT 0x6ffffff9 /* number of RELATIVE relocations */ -#define DT_RELCOUNT 0x6ffffffa /* number of RELATIVE relocations */ -#define DT_FLAGS_1 0x6ffffffb /* state flags - see DF_1_* defs */ -#define DT_VERDEF 0x6ffffffc /* Address of verdef section. */ -#define DT_VERDEFNUM 0x6ffffffd /* Number of elems in verdef section */ -#define DT_VERNEED 0x6ffffffe /* Address of verneed section. */ -#define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */ - -#define DT_LOPROC 0x70000000 /* First processor-specific type. */ -#define DT_DEPRECATED_SPARC_REGISTER 0x7000001 -#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */ -#define DT_USED 0x7ffffffe /* ignored - same as needed */ -#define DT_FILTER 0x7fffffff /* shared library filter name */ -#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */ - -/* Values for DT_FLAGS */ -#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may - make reference to the $ORIGIN substitution - string */ -#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */ -#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in - non-writable segments. */ -#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should - process all relocations for the object - containing this entry before transferring - control to the program. */ -#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or - executable contains code using a static - thread-local storage scheme. */ - -/* Values for n_type. Used in core files. */ -#define NT_PRSTATUS 1 /* Process status. */ -#define NT_FPREGSET 2 /* Floating point registers. */ -#define NT_PRPSINFO 3 /* Process state info. */ - -/* Symbol Binding - ELFNN_ST_BIND - st_info */ -#define STB_LOCAL 0 /* Local symbol */ -#define STB_GLOBAL 1 /* Global symbol */ -#define STB_WEAK 2 /* like global - lower precedence */ -#define STB_LOOS 10 /* Reserved range for operating system */ -#define STB_HIOS 12 /* specific semantics. */ -#define STB_LOPROC 13 /* reserved range for processor */ -#define STB_HIPROC 15 /* specific semantics. */ - -/* Symbol type - ELFNN_ST_TYPE - st_info */ -#define STT_NOTYPE 0 /* Unspecified type. */ -#define STT_OBJECT 1 /* Data object. */ -#define STT_FUNC 2 /* Function. */ -#define STT_SECTION 3 /* Section. */ -#define STT_FILE 4 /* Source file. */ -#define STT_COMMON 5 /* Uninitialized common block. */ -#define STT_TLS 6 /* TLS object. */ -#define STT_NUM 7 -#define STT_LOOS 10 /* Reserved range for operating system */ -#define STT_HIOS 12 /* specific semantics. */ -#define STT_LOPROC 13 /* reserved range for processor */ -#define STT_HIPROC 15 /* specific semantics. */ - -/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ -#define STV_DEFAULT 0x0 /* Default visibility (see binding). */ -#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */ -#define STV_HIDDEN 0x2 /* Not visible. */ -#define STV_PROTECTED 0x3 /* Visible but not preemptible. */ -#define STV_EXPORTED 0x4 -#define STV_SINGLETON 0x5 -#define STV_ELIMINATE 0x6 - -/* Special symbol table indexes. */ -#define STN_UNDEF 0 /* Undefined symbol index. */ - -/* Symbol versioning flags. */ -#define VER_DEF_CURRENT 1 -#define VER_DEF_IDX(x) VER_NDX(x) - -#define VER_FLG_BASE 0x01 -#define VER_FLG_WEAK 0x02 - -#define VER_NEED_CURRENT 1 -#define VER_NEED_WEAK (1u << 15) -#define VER_NEED_HIDDEN VER_NDX_HIDDEN -#define VER_NEED_IDX(x) VER_NDX(x) - -#define VER_NDX_LOCAL 0 -#define VER_NDX_GLOBAL 1 -#define VER_NDX_GIVEN 2 - -#define VER_NDX_HIDDEN (1u << 15) -#define VER_NDX(x) ((x) & ~(1u << 15)) - -#define CA_SUNW_NULL 0 -#define CA_SUNW_HW_1 1 /* first hardware capabilities entry */ -#define CA_SUNW_SF_1 2 /* first software capabilities entry */ - -/* - * Syminfo flag values - */ -#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association */ - /* to object containing defn. */ -#define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */ -#define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */ -#define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be */ - /* lazily-loaded */ -#define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to */ - /* object containing defn. */ -#define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference */ - /* directly bind to this symbol */ -#define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */ -#define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */ - -/* - * Syminfo.si_boundto values. - */ -#define SYMINFO_BT_SELF 0xffff /* symbol bound to self */ -#define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */ -#define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */ -#define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */ -#define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */ - -/* - * Syminfo version values. - */ -#define SYMINFO_NONE 0 /* Syminfo version */ -#define SYMINFO_CURRENT 1 -#define SYMINFO_NUM 2 - -/* - * Relocation types. - * - * All machine architectures are defined here to allow tools on one to - * handle others. - */ - -#define R_386_NONE 0 /* No relocation. */ -#define R_386_32 1 /* Add symbol value. */ -#define R_386_PC32 2 /* Add PC-relative symbol value. */ -#define R_386_GOT32 3 /* Add PC-relative GOT offset. */ -#define R_386_PLT32 4 /* Add PC-relative PLT offset. */ -#define R_386_COPY 5 /* Copy data from shared object. */ -#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ -#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */ -#define R_386_RELATIVE 8 /* Add load address of shared object. */ -#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ -#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ -#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */ -#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */ -#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */ -#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */ -#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */ -#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */ -#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */ -#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */ -#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */ -#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */ -#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */ -#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */ -#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */ -#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */ -#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */ -#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */ -#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */ -#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */ -#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */ -#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ - -#define R_ARM_NONE 0 /* No relocation. */ -#define R_ARM_PC24 1 -#define R_ARM_ABS32 2 -#define R_ARM_REL32 3 -#define R_ARM_PC13 4 -#define R_ARM_ABS16 5 -#define R_ARM_ABS12 6 -#define R_ARM_THM_ABS5 7 -#define R_ARM_ABS8 8 -#define R_ARM_SBREL32 9 -#define R_ARM_THM_PC22 10 -#define R_ARM_THM_PC8 11 -#define R_ARM_AMP_VCALL9 12 -#define R_ARM_SWI24 13 -#define R_ARM_THM_SWI8 14 -#define R_ARM_XPC25 15 -#define R_ARM_THM_XPC22 16 -#define R_ARM_COPY 20 /* Copy data from shared object. */ -#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ -#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ -#define R_ARM_RELATIVE 23 /* Add load address of shared object. */ -#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */ -#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */ -#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */ -#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */ -#define R_ARM_GNU_VTENTRY 100 -#define R_ARM_GNU_VTINHERIT 101 -#define R_ARM_RSBREL32 250 -#define R_ARM_THM_RPC22 251 -#define R_ARM_RREL32 252 -#define R_ARM_RABS32 253 -#define R_ARM_RPC24 254 -#define R_ARM_RBASE 255 - -/* Name Value Field Calculation */ -#define R_IA_64_NONE 0 /* None */ -#define R_IA_64_IMM14 0x21 /* immediate14 S + A */ -#define R_IA_64_IMM22 0x22 /* immediate22 S + A */ -#define R_IA_64_IMM64 0x23 /* immediate64 S + A */ -#define R_IA_64_DIR32MSB 0x24 /* word32 MSB S + A */ -#define R_IA_64_DIR32LSB 0x25 /* word32 LSB S + A */ -#define R_IA_64_DIR64MSB 0x26 /* word64 MSB S + A */ -#define R_IA_64_DIR64LSB 0x27 /* word64 LSB S + A */ -#define R_IA_64_GPREL22 0x2a /* immediate22 @gprel(S + A) */ -#define R_IA_64_GPREL64I 0x2b /* immediate64 @gprel(S + A) */ -#define R_IA_64_GPREL32MSB 0x2c /* word32 MSB @gprel(S + A) */ -#define R_IA_64_GPREL32LSB 0x2d /* word32 LSB @gprel(S + A) */ -#define R_IA_64_GPREL64MSB 0x2e /* word64 MSB @gprel(S + A) */ -#define R_IA_64_GPREL64LSB 0x2f /* word64 LSB @gprel(S + A) */ -#define R_IA_64_LTOFF22 0x32 /* immediate22 @ltoff(S + A) */ -#define R_IA_64_LTOFF64I 0x33 /* immediate64 @ltoff(S + A) */ -#define R_IA_64_PLTOFF22 0x3a /* immediate22 @pltoff(S + A) */ -#define R_IA_64_PLTOFF64I 0x3b /* immediate64 @pltoff(S + A) */ -#define R_IA_64_PLTOFF64MSB 0x3e /* word64 MSB @pltoff(S + A) */ -#define R_IA_64_PLTOFF64LSB 0x3f /* word64 LSB @pltoff(S + A) */ -#define R_IA_64_FPTR64I 0x43 /* immediate64 @fptr(S + A) */ -#define R_IA_64_FPTR32MSB 0x44 /* word32 MSB @fptr(S + A) */ -#define R_IA_64_FPTR32LSB 0x45 /* word32 LSB @fptr(S + A) */ -#define R_IA_64_FPTR64MSB 0x46 /* word64 MSB @fptr(S + A) */ -#define R_IA_64_FPTR64LSB 0x47 /* word64 LSB @fptr(S + A) */ -#define R_IA_64_PCREL60B 0x48 /* immediate60 form1 S + A - P */ -#define R_IA_64_PCREL21B 0x49 /* immediate21 form1 S + A - P */ -#define R_IA_64_PCREL21M 0x4a /* immediate21 form2 S + A - P */ -#define R_IA_64_PCREL21F 0x4b /* immediate21 form3 S + A - P */ -#define R_IA_64_PCREL32MSB 0x4c /* word32 MSB S + A - P */ -#define R_IA_64_PCREL32LSB 0x4d /* word32 LSB S + A - P */ -#define R_IA_64_PCREL64MSB 0x4e /* word64 MSB S + A - P */ -#define R_IA_64_PCREL64LSB 0x4f /* word64 LSB S + A - P */ -#define R_IA_64_LTOFF_FPTR22 0x52 /* immediate22 @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR64I 0x53 /* immediate64 @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR32MSB 0x54 /* word32 MSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR32LSB 0x55 /* word32 LSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR64MSB 0x56 /* word64 MSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_LTOFF_FPTR64LSB 0x57 /* word64 LSB @ltoff(@fptr(S + A)) */ -#define R_IA_64_SEGREL32MSB 0x5c /* word32 MSB @segrel(S + A) */ -#define R_IA_64_SEGREL32LSB 0x5d /* word32 LSB @segrel(S + A) */ -#define R_IA_64_SEGREL64MSB 0x5e /* word64 MSB @segrel(S + A) */ -#define R_IA_64_SEGREL64LSB 0x5f /* word64 LSB @segrel(S + A) */ -#define R_IA_64_SECREL32MSB 0x64 /* word32 MSB @secrel(S + A) */ -#define R_IA_64_SECREL32LSB 0x65 /* word32 LSB @secrel(S + A) */ -#define R_IA_64_SECREL64MSB 0x66 /* word64 MSB @secrel(S + A) */ -#define R_IA_64_SECREL64LSB 0x67 /* word64 LSB @secrel(S + A) */ -#define R_IA_64_REL32MSB 0x6c /* word32 MSB BD + A */ -#define R_IA_64_REL32LSB 0x6d /* word32 LSB BD + A */ -#define R_IA_64_REL64MSB 0x6e /* word64 MSB BD + A */ -#define R_IA_64_REL64LSB 0x6f /* word64 LSB BD + A */ -#define R_IA_64_LTV32MSB 0x74 /* word32 MSB S + A */ -#define R_IA_64_LTV32LSB 0x75 /* word32 LSB S + A */ -#define R_IA_64_LTV64MSB 0x76 /* word64 MSB S + A */ -#define R_IA_64_LTV64LSB 0x77 /* word64 LSB S + A */ -#define R_IA_64_PCREL21BI 0x79 /* immediate21 form1 S + A - P */ -#define R_IA_64_PCREL22 0x7a /* immediate22 S + A - P */ -#define R_IA_64_PCREL64I 0x7b /* immediate64 S + A - P */ -#define R_IA_64_IPLTMSB 0x80 /* function descriptor MSB special */ -#define R_IA_64_IPLTLSB 0x81 /* function descriptor LSB speciaal */ -#define R_IA_64_SUB 0x85 /* immediate64 A - S */ -#define R_IA_64_LTOFF22X 0x86 /* immediate22 special */ -#define R_IA_64_LDXMOV 0x87 /* immediate22 special */ -#define R_IA_64_TPREL14 0x91 /* imm14 @tprel(S + A) */ -#define R_IA_64_TPREL22 0x92 /* imm22 @tprel(S + A) */ -#define R_IA_64_TPREL64I 0x93 /* imm64 @tprel(S + A) */ -#define R_IA_64_TPREL64MSB 0x96 /* word64 MSB @tprel(S + A) */ -#define R_IA_64_TPREL64LSB 0x97 /* word64 LSB @tprel(S + A) */ -#define R_IA_64_LTOFF_TPREL22 0x9a /* imm22 @ltoff(@tprel(S+A)) */ -#define R_IA_64_DTPMOD64MSB 0xa6 /* word64 MSB @dtpmod(S + A) */ -#define R_IA_64_DTPMOD64LSB 0xa7 /* word64 LSB @dtpmod(S + A) */ -#define R_IA_64_LTOFF_DTPMOD22 0xaa /* imm22 @ltoff(@dtpmod(S+A)) */ -#define R_IA_64_DTPREL14 0xb1 /* imm14 @dtprel(S + A) */ -#define R_IA_64_DTPREL22 0xb2 /* imm22 @dtprel(S + A) */ -#define R_IA_64_DTPREL64I 0xb3 /* imm64 @dtprel(S + A) */ -#define R_IA_64_DTPREL32MSB 0xb4 /* word32 MSB @dtprel(S + A) */ -#define R_IA_64_DTPREL32LSB 0xb5 /* word32 LSB @dtprel(S + A) */ -#define R_IA_64_DTPREL64MSB 0xb6 /* word64 MSB @dtprel(S + A) */ -#define R_IA_64_DTPREL64LSB 0xb7 /* word64 LSB @dtprel(S + A) */ -#define R_IA_64_LTOFF_DTPREL22 0xba /* imm22 @ltoff(@dtprel(S+A)) */ - -#define R_MIPS_NONE 0 /* No reloc */ -#define R_MIPS_16 1 /* Direct 16 bit */ -#define R_MIPS_32 2 /* Direct 32 bit */ -#define R_MIPS_REL32 3 /* PC relative 32 bit */ -#define R_MIPS_26 4 /* Direct 26 bit shifted */ -#define R_MIPS_HI16 5 /* High 16 bit */ -#define R_MIPS_LO16 6 /* Low 16 bit */ -#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ -#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ -#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ -#define R_MIPS_PC16 10 /* PC relative 16 bit */ -#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ -#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ -#define R_MIPS_GOTHI16 21 /* GOT HI 16 bit */ -#define R_MIPS_GOTLO16 22 /* GOT LO 16 bit */ -#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ -#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ - -#define R_PPC_NONE 0 /* No relocation. */ -#define R_PPC_ADDR32 1 -#define R_PPC_ADDR24 2 -#define R_PPC_ADDR16 3 -#define R_PPC_ADDR16_LO 4 -#define R_PPC_ADDR16_HI 5 -#define R_PPC_ADDR16_HA 6 -#define R_PPC_ADDR14 7 -#define R_PPC_ADDR14_BRTAKEN 8 -#define R_PPC_ADDR14_BRNTAKEN 9 -#define R_PPC_REL24 10 -#define R_PPC_REL14 11 -#define R_PPC_REL14_BRTAKEN 12 -#define R_PPC_REL14_BRNTAKEN 13 -#define R_PPC_GOT16 14 -#define R_PPC_GOT16_LO 15 -#define R_PPC_GOT16_HI 16 -#define R_PPC_GOT16_HA 17 -#define R_PPC_PLTREL24 18 -#define R_PPC_COPY 19 -#define R_PPC_GLOB_DAT 20 -#define R_PPC_JMP_SLOT 21 -#define R_PPC_RELATIVE 22 -#define R_PPC_LOCAL24PC 23 -#define R_PPC_UADDR32 24 -#define R_PPC_UADDR16 25 -#define R_PPC_REL32 26 -#define R_PPC_PLT32 27 -#define R_PPC_PLTREL32 28 -#define R_PPC_PLT16_LO 29 -#define R_PPC_PLT16_HI 30 -#define R_PPC_PLT16_HA 31 -#define R_PPC_SDAREL16 32 -#define R_PPC_SECTOFF 33 -#define R_PPC_SECTOFF_LO 34 -#define R_PPC_SECTOFF_HI 35 -#define R_PPC_SECTOFF_HA 36 - -/* - * TLS relocations - */ -#define R_PPC_TLS 67 -#define R_PPC_DTPMOD32 68 -#define R_PPC_TPREL16 69 -#define R_PPC_TPREL16_LO 70 -#define R_PPC_TPREL16_HI 71 -#define R_PPC_TPREL16_HA 72 -#define R_PPC_TPREL32 73 -#define R_PPC_DTPREL16 74 -#define R_PPC_DTPREL16_LO 75 -#define R_PPC_DTPREL16_HI 76 -#define R_PPC_DTPREL16_HA 77 -#define R_PPC_DTPREL32 78 -#define R_PPC_GOT_TLSGD16 79 -#define R_PPC_GOT_TLSGD16_LO 80 -#define R_PPC_GOT_TLSGD16_HI 81 -#define R_PPC_GOT_TLSGD16_HA 82 -#define R_PPC_GOT_TLSLD16 83 -#define R_PPC_GOT_TLSLD16_LO 84 -#define R_PPC_GOT_TLSLD16_HI 85 -#define R_PPC_GOT_TLSLD16_HA 86 -#define R_PPC_GOT_TPREL16 87 -#define R_PPC_GOT_TPREL16_LO 88 -#define R_PPC_GOT_TPREL16_HI 89 -#define R_PPC_GOT_TPREL16_HA 90 - -/* - * The remaining relocs are from the Embedded ELF ABI, and are not in the - * SVR4 ELF ABI. - */ - -#define R_PPC_EMB_NADDR32 101 -#define R_PPC_EMB_NADDR16 102 -#define R_PPC_EMB_NADDR16_LO 103 -#define R_PPC_EMB_NADDR16_HI 104 -#define R_PPC_EMB_NADDR16_HA 105 -#define R_PPC_EMB_SDAI16 106 -#define R_PPC_EMB_SDA2I16 107 -#define R_PPC_EMB_SDA2REL 108 -#define R_PPC_EMB_SDA21 109 -#define R_PPC_EMB_MRKREF 110 -#define R_PPC_EMB_RELSEC16 111 -#define R_PPC_EMB_RELST_LO 112 -#define R_PPC_EMB_RELST_HI 113 -#define R_PPC_EMB_RELST_HA 114 -#define R_PPC_EMB_BIT_FLD 115 -#define R_PPC_EMB_RELSDA 116 - -#define R_SPARC_NONE 0 -#define R_SPARC_8 1 -#define R_SPARC_16 2 -#define R_SPARC_32 3 -#define R_SPARC_DISP8 4 -#define R_SPARC_DISP16 5 -#define R_SPARC_DISP32 6 -#define R_SPARC_WDISP30 7 -#define R_SPARC_WDISP22 8 -#define R_SPARC_HI22 9 -#define R_SPARC_22 10 -#define R_SPARC_13 11 -#define R_SPARC_LO10 12 -#define R_SPARC_GOT10 13 -#define R_SPARC_GOT13 14 -#define R_SPARC_GOT22 15 -#define R_SPARC_PC10 16 -#define R_SPARC_PC22 17 -#define R_SPARC_WPLT30 18 -#define R_SPARC_COPY 19 -#define R_SPARC_GLOB_DAT 20 -#define R_SPARC_JMP_SLOT 21 -#define R_SPARC_RELATIVE 22 -#define R_SPARC_UA32 23 -#define R_SPARC_PLT32 24 -#define R_SPARC_HIPLT22 25 -#define R_SPARC_LOPLT10 26 -#define R_SPARC_PCPLT32 27 -#define R_SPARC_PCPLT22 28 -#define R_SPARC_PCPLT10 29 -#define R_SPARC_10 30 -#define R_SPARC_11 31 -#define R_SPARC_64 32 -#define R_SPARC_OLO10 33 -#define R_SPARC_HH22 34 -#define R_SPARC_HM10 35 -#define R_SPARC_LM22 36 -#define R_SPARC_PC_HH22 37 -#define R_SPARC_PC_HM10 38 -#define R_SPARC_PC_LM22 39 -#define R_SPARC_WDISP16 40 -#define R_SPARC_WDISP19 41 -#define R_SPARC_GLOB_JMP 42 -#define R_SPARC_7 43 -#define R_SPARC_5 44 -#define R_SPARC_6 45 -#define R_SPARC_DISP64 46 -#define R_SPARC_PLT64 47 -#define R_SPARC_HIX22 48 -#define R_SPARC_LOX10 49 -#define R_SPARC_H44 50 -#define R_SPARC_M44 51 -#define R_SPARC_L44 52 -#define R_SPARC_REGISTER 53 -#define R_SPARC_UA64 54 -#define R_SPARC_UA16 55 -#define R_SPARC_TLS_GD_HI22 56 -#define R_SPARC_TLS_GD_LO10 57 -#define R_SPARC_TLS_GD_ADD 58 -#define R_SPARC_TLS_GD_CALL 59 -#define R_SPARC_TLS_LDM_HI22 60 -#define R_SPARC_TLS_LDM_LO10 61 -#define R_SPARC_TLS_LDM_ADD 62 -#define R_SPARC_TLS_LDM_CALL 63 -#define R_SPARC_TLS_LDO_HIX22 64 -#define R_SPARC_TLS_LDO_LOX10 65 -#define R_SPARC_TLS_LDO_ADD 66 -#define R_SPARC_TLS_IE_HI22 67 -#define R_SPARC_TLS_IE_LO10 68 -#define R_SPARC_TLS_IE_LD 69 -#define R_SPARC_TLS_IE_LDX 70 -#define R_SPARC_TLS_IE_ADD 71 -#define R_SPARC_TLS_LE_HIX22 72 -#define R_SPARC_TLS_LE_LOX10 73 -#define R_SPARC_TLS_DTPMOD32 74 -#define R_SPARC_TLS_DTPMOD64 75 -#define R_SPARC_TLS_DTPOFF32 76 -#define R_SPARC_TLS_DTPOFF64 77 -#define R_SPARC_TLS_TPOFF32 78 -#define R_SPARC_TLS_TPOFF64 79 - -#define R_X86_64_NONE 0 /* No relocation. */ -#define R_X86_64_64 1 /* Add 64 bit symbol value. */ -#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */ -#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */ -#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */ -#define R_X86_64_COPY 5 /* Copy data from shared object. */ -#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */ -#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */ -#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */ -#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */ -#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */ -#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */ -#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ -#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ -#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ -#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ -#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ -#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */ -#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */ -#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */ -#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */ -#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ -#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ -#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ - - -#endif /* !_SYS_ELF_COMMON_H_ */ diff --git a/include/win/pthread.h b/include/win/pthread.h deleted file mode 100644 index 8a0b0a18..00000000 --- a/include/win/pthread.h +++ /dev/null @@ -1,30 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -// #include -#include - -#define PTHREAD_DESTRUCTOR_ITERATIONS 0 -#define PTHREAD_MUTEX_INITIALIZER 0 -#define PTHREAD_ONCE_INIT 0 - -typedef long pthread_key_t; -typedef long pthread_mutex_t; -typedef long pthread_mutexattr_t; -typedef long pthread_once_t; - -int pthread_key_create(pthread_key_t *, void (*)(void*)); -int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *); -int pthread_mutex_lock(pthread_mutex_t *); -int pthread_mutex_unlock(pthread_mutex_t *); -int pthread_once(pthread_once_t *, void (*)(void)); -int pthread_setspecific(pthread_key_t, const void *); - -#endif // _MSC_VER diff --git a/include/win/signal.h b/include/win/signal.h deleted file mode 100644 index 48e8e3f9..00000000 --- a/include/win/signal.h +++ /dev/null @@ -1,40 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -// Posix is a superset of the ISO C signal.h -// include ISO C version first -#include <../ucrt/signal.h> -#include -#include - -#if defined(__linux__) && defined(__x86_64__) -# define SIZEOF_SIGINFO 128 -#elif defined(__linux__) && defined(__aarch64__) -# define SIZEOF_SIGINFO 128 -#elif defined(__linux__) && defined(__arm__) -# define SIZEOF_SIGINFO 128 -#elif !defined(SIZEOF_SIGINFO) - // It is not clear whether the sizeof(siginfo_t) is important - // While compiling on Windows the members are not referenced... - // However the size maybe important during a case or a memcpy - // Barring a full audit it could be important so require the size to be defined -# error SIZEOF_SIGINFO is unknown for this target -#endif - -typedef struct siginfo -{ - uint8_t content[SIZEOF_SIGINFO]; -} siginfo_t; - -typedef long sigset_t; - -int sigfillset(sigset_t *set); - -#endif // _MSC_VER diff --git a/include/win/sys/mman.h b/include/win/sys/mman.h deleted file mode 100644 index 51d2d108..00000000 --- a/include/win/sys/mman.h +++ /dev/null @@ -1,23 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -#include - -#define MAP_FAILED (void *) -1 -#define MAP_ANONYMOUS 1 -#define MAP_ANON MAP_ANONYMOUS -#define MAP_PRIVATE 2 -#define PROT_READ 4 -#define PROT_WRITE 8 - -void* mmap(void *, size_t, int, int, int, size_t); -int munmap(void *, size_t); - -#endif // _MSC_VER diff --git a/include/win/sys/syscall.h b/include/win/sys/syscall.h deleted file mode 100644 index d655d1a8..00000000 --- a/include/win/sys/syscall.h +++ /dev/null @@ -1,11 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -#endif // _MSC_VER diff --git a/include/win/sys/types.h b/include/win/sys/types.h deleted file mode 100644 index 7b131f6e..00000000 --- a/include/win/sys/types.h +++ /dev/null @@ -1,19 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -// Posix is a superset of the ISO C sys/types -// include ISO C version first -#include <../ucrt/sys/types.h> -#include - -typedef int pid_t; -typedef ptrdiff_t ssize_t; - -#endif // _MSC_VER diff --git a/include/win/sys/ucontext.h b/include/win/sys/ucontext.h deleted file mode 100644 index c37c3aba..00000000 --- a/include/win/sys/ucontext.h +++ /dev/null @@ -1,42 +0,0 @@ -// This is an incomplete & imprecice implementation of the *nix file -// by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows -#include - -#if defined(__linux__) && defined(__x86_64__) -# define SIZEOF_UCONTEXT 936 -#elif defined(__linux__) && defined(__aarch64__) -# define SIZEOF_UCONTEXT 4560 -#elif defined(__linux__) && defined(__arm__) -# define SIZEOF_UCONTEXT 744 -#elif !defined(SIZEOF_UCONTEXT) - // It is not clear whether the sizeof(ucontext_t) is important - // While compiling on Windows the members are not referenced... - // However the size maybe important during a case or a memcpy - // Barring a full audit it could be important so require the size to be defined -# error SIZEOF_UCONTEXT is unknown for this target -#endif - -typedef struct ucontext -{ - uint8_t content[SIZEOF_UCONTEXT]; -} ucontext_t; - -#ifdef __aarch64__ -// These types are used in the definition of the aarch64 unw_tdep_context_t -// They are not used in UNW_REMOTE_ONLY, so typedef them as something -typedef long sigset_t; -typedef long stack_t; - -// Windows SDK defines reserved. It conflicts with arm64 ucontext -// Undefine it -#undef __reserved -#endif - -#endif // _MSC_VER diff --git a/include/win/ucontext.h b/include/win/ucontext.h deleted file mode 100644 index fb5aaf73..00000000 --- a/include/win/ucontext.h +++ /dev/null @@ -1,13 +0,0 @@ -// This is an incomplete & imprecice implementation of the *nix file -// by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -#include - -#endif // _MSC_VER diff --git a/include/win/unistd.h b/include/win/unistd.h deleted file mode 100644 index 1a3aee5d..00000000 --- a/include/win/unistd.h +++ /dev/null @@ -1,28 +0,0 @@ -// This is an incomplete & imprecice implementation of the Posix -// standard file by the same name - - -// Since this is only intended for VC++ compilers -// use #pragma once instead of guard macros -#pragma once - -#ifdef _MSC_VER // Only for cross compilation to windows - -#ifndef UNW_REMOTE_ONLY -// This is solely intended to enable compilation of libunwind -// for UNW_REMOTE_ONLY on windows -#error Cross compilation of libunwind on Windows can only support UNW_REMOTE_ONLY -#endif - -#include -#include -#include -#include - -int close(int); -int getpagesize(void); -int open(const char *, int, ...); -ssize_t read(int fd, void *buf, size_t count); -ssize_t write(int, const void *, size_t); - -#endif // _MSC_VER diff --git a/include/x86/jmpbuf.h b/include/x86/jmpbuf.h deleted file mode 100644 index 94d5984f..00000000 --- a/include/x86/jmpbuf.h +++ /dev/null @@ -1,31 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -/* Use glibc's jump-buffer indices; NPTL peeks at SP: */ - -#define JB_SP 4 -#define JB_RP 5 -#define JB_MASK_SAVED 6 -#define JB_MASK 7 diff --git a/libunwind.gni b/libunwind.gni index 91b23013..dbcea738 100644 --- a/libunwind.gni +++ b/libunwind.gni @@ -9,83 +9,83 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. +# limitations under the License. arm64_source_local = [ - "src/aarch64/Lcreate_addr_space.c", - "src/aarch64/Lget_proc_info.c", - "src/aarch64/Lget_save_loc.c", - "src/aarch64/Lglobal.c", - "src/aarch64/Linit.c", - "src/aarch64/Linit_local.c", - "src/aarch64/Linit_remote.c", - "src/aarch64/Lis_signal_frame.c", - "src/aarch64/Lregs.c", - "src/aarch64/Lresume.c", - "src/aarch64/Lstash_frame.c", - "src/aarch64/Lstep.c", - "src/aarch64/Ltrace.c", + "libunwind/src/aarch64/Lcreate_addr_space.c", + "libunwind/src/aarch64/Lget_proc_info.c", + "libunwind/src/aarch64/Lget_save_loc.c", + "libunwind/src/aarch64/Lglobal.c", + "libunwind/src/aarch64/Linit.c", + "libunwind/src/aarch64/Linit_local.c", + "libunwind/src/aarch64/Linit_remote.c", + "libunwind/src/aarch64/Lis_signal_frame.c", + "libunwind/src/aarch64/Lregs.c", + "libunwind/src/aarch64/Lresume.c", + "libunwind/src/aarch64/Lstash_frame.c", + "libunwind/src/aarch64/Lstep.c", + "libunwind/src/aarch64/Ltrace.c", ] arm_source_local = [ - "src/arm/Lcreate_addr_space.c", - "src/arm/Lex_tables.c", - "src/arm/Lget_proc_info.c", - "src/arm/Lget_save_loc.c", - "src/arm/Lglobal.c", - "src/arm/Linit.c", - "src/arm/Linit_local.c", - "src/arm/Linit_remote.c", - "src/arm/Los-linux.c", - "src/arm/Lregs.c", - "src/arm/Lresume.c", - "src/arm/Lstash_frame.c", - "src/arm/Lstep.c", - "src/arm/Ltrace.c", + "libunwind/src/arm/Lcreate_addr_space.c", + "libunwind/src/arm/Lex_tables.c", + "libunwind/src/arm/Lget_proc_info.c", + "libunwind/src/arm/Lget_save_loc.c", + "libunwind/src/arm/Lglobal.c", + "libunwind/src/arm/Linit.c", + "libunwind/src/arm/Linit_local.c", + "libunwind/src/arm/Linit_remote.c", + "libunwind/src/arm/Los-linux.c", + "libunwind/src/arm/Lregs.c", + "libunwind/src/arm/Lresume.c", + "libunwind/src/arm/Lstash_frame.c", + "libunwind/src/arm/Lstep.c", + "libunwind/src/arm/Ltrace.c", ] riscv64_source_local = [ - "src/riscv/Lcreate_addr_space.c", - "src/riscv/Lget_proc_info.c", - "src/riscv/Lget_save_loc.c", - "src/riscv/Lglobal.c", - "src/riscv/Linit.c", - "src/riscv/Linit_local.c", - "src/riscv/Linit_remote.c", - "src/riscv/Lis_signal_frame.c", - "src/riscv/Lreg_states_iterate.c", - "src/riscv/Lregs.c", - "src/riscv/Lresume.c", - "src/riscv/Lstep.c", + "libunwind/src/riscv/Lcreate_addr_space.c", + "libunwind/src/riscv/Lget_proc_info.c", + "libunwind/src/riscv/Lget_save_loc.c", + "libunwind/src/riscv/Lglobal.c", + "libunwind/src/riscv/Linit.c", + "libunwind/src/riscv/Linit_local.c", + "libunwind/src/riscv/Linit_remote.c", + "libunwind/src/riscv/Lis_signal_frame.c", + "libunwind/src/riscv/Lreg_states_iterate.c", + "libunwind/src/riscv/Lregs.c", + "libunwind/src/riscv/Lresume.c", + "libunwind/src/riscv/Lstep.c", ] x64_source_local = [ - "src/x86_64/Lcreate_addr_space.c", - "src/x86_64/Lget_proc_info.c", - "src/x86_64/Lget_save_loc.c", - "src/x86_64/Lglobal.c", - "src/x86_64/Linit.c", - "src/x86_64/Linit_local.c", - "src/x86_64/Linit_remote.c", - "src/x86_64/Los-linux.c", - "src/x86_64/Lregs.c", - "src/x86_64/Lresume.c", - "src/x86_64/Lstash_frame.c", - "src/x86_64/Lstep.c", - "src/x86_64/Ltrace.c", + "libunwind/src/x86_64/Lcreate_addr_space.c", + "libunwind/src/x86_64/Lget_proc_info.c", + "libunwind/src/x86_64/Lget_save_loc.c", + "libunwind/src/x86_64/Lglobal.c", + "libunwind/src/x86_64/Linit.c", + "libunwind/src/x86_64/Linit_local.c", + "libunwind/src/x86_64/Linit_remote.c", + "libunwind/src/x86_64/Los-linux.c", + "libunwind/src/x86_64/Lregs.c", + "libunwind/src/x86_64/Lresume.c", + "libunwind/src/x86_64/Lstash_frame.c", + "libunwind/src/x86_64/Lstep.c", + "libunwind/src/x86_64/Ltrace.c", ] libunwind_la_SOURCES_local = [ - "src/mi/Ldyn-extract.c", - "src/mi/Lfind_dynamic_proc_info.c", - "src/mi/Lget_proc_info_by_ip.c", - "src/mi/Lget_proc_name.c", - "src/mi/Lput_dynamic_unwind_info.c", - "src/mi/Ldestroy_addr_space.c", - "src/mi/Lget_reg.c", - "src/mi/Lset_reg.c", - "src/mi/Lget_fpreg.c", - "src/mi/Lset_fpreg.c", - "src/mi/Lset_caching_policy.c", - "src/mi/Lset_cache_size.c", + "libunwind/src/mi/Ldyn-extract.c", + "libunwind/src/mi/Lfind_dynamic_proc_info.c", + "libunwind/src/mi/Lget_proc_info_by_ip.c", + "libunwind/src/mi/Lget_proc_name.c", + "libunwind/src/mi/Lput_dynamic_unwind_info.c", + "libunwind/src/mi/Ldestroy_addr_space.c", + "libunwind/src/mi/Lget_reg.c", + "libunwind/src/mi/Lset_reg.c", + "libunwind/src/mi/Lget_fpreg.c", + "libunwind/src/mi/Lset_fpreg.c", + "libunwind/src/mi/Lset_caching_policy.c", + "libunwind/src/mi/Lset_cache_size.c", ] diff --git a/libunwind.spec b/libunwind.spec new file mode 100644 index 00000000..288974cc --- /dev/null +++ b/libunwind.spec @@ -0,0 +1,158 @@ +Name: libunwind +Epoch: 2 +Version: 1.6.2 +Release: 7 +Summary: Libunwind provides a C ABI to determine the call-chain of a program +License: BSD +URL: http://savannah.nongnu.org/projects/libunwind +Source: http://download-mirror.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz + +Patch0001: 0001-fix-byte_order_is_valid-function-logic.patch +Patch2: backport-check-namespace.sh-adjust-aarch64-symbols.patch +Patch3: backport-tests-run-coredump-unwind-Skip-test-if-no-coredump-h.patch +Patch4: backport-aarch64-unw_step-validates-address-before-calling-dwarf_get.patch +Patch5: backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch +Patch6: backport-fix-run-ptrace-mapper-test-case-failed.patch + +ExclusiveArch: aarch64 %{ix86} x86_64 + +BuildRequires: automake libtool autoconf texlive-latex2man gcc-c++ + +%description +Libunwind defines a portable and efficient C programming interface (API) to +determine the call-chain of a program. The API additionally provides the means +to manipulate the preserved (callee-saved) state of each call-frame and to +resume execution at any point in the call-chain (non-local goto). The API +supports both local (same-process) and remote (across-process) operation. + +%package devel +Summary: Development files for libunwind +Requires: libunwind = %{epoch}:%{version}-%{release} + +%description devel +This package contains development files for libunwind. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +aclocal +libtoolize --force +autoheader +automake --add-missing +autoconf +%configure --enable-static --enable-shared --enable-setjmp=no +%make_build + +%install +%make_install +%delete_la + +# /usr/include/libunwind-ptrace.h +# [...] aren't really part of the libunwind API. They are implemented in +# a archive library called libunwind-ptrace.a. +mv -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a-save +rm -f $RPM_BUILD_ROOT%{_libdir}/libunwind*.a +mv -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a-save $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a +rm -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace*.so* + +# fix multilib conflicts +touch -r NEWS $RPM_BUILD_ROOT%{_includedir}/libunwind.h + +%check +make check || true + +%pre + +%preun + +%ldconfig_scriptlets + +%files +%defattr(-,root,root) +%license COPYING +%{_libdir}/libunwind*.so.* + +%files devel +%defattr(-,root,root) +%{_libdir}/pkgconfig/libunwind*.pc +# does not get installed for REMOTE_ONLY targets - check it. +%{_includedir}/unwind.h +%{_includedir}/libunwind*.h +%{_libdir}/libunwind-ptrace.a +%{_libdir}/libunwind*.so + +%files help +%defattr(-,root,root) +%doc README NEWS +%{_mandir}/*/* + +%changelog +* Tue Jul 11 2023 chenziyang - 2:1.6.2-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:backport upstream patch to fix failed run-ptrace-mapper testcase + +* Mon Jul 03 2023 chenziyang - 2:1.6.2-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix failed testcase by editing test-ptrace testcase + +* Tue Jun 20 2023 wangjiang - 2:1.6.2-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix failed testcase + +* Mon Feb 20 2023 shixuantong - 2:1.6.2-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix some test fail + +* Fri Dec 16 2022 Bin Hu - 2:1.6.2-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix byte_order_is_valid function logic + +* Mon Nov 7 2022 Bin Hu - 2:1.6.2-1 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:update version 1.6.2 + +* Tue Oct 25 2022 zhangruifang - 2:1.5.0-3 +- Rebuild for next release +- fix bogus date in changelog + +* Tue Apr 26 2022 renhongxun - 2:1.5.0-2 +- add epoch + +* Wed Dec 22 2021 shangyibin - 1.5.0-1 +- Upgrade to version 1.5.0 + +* Fri Jul 30 2021 liudabo - 1.4.0-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Fix gcc build + +* Mon Mar 30 2020 wenzhanli - 1.4.0-1 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:update version 1.4.0 + +* Sun Jan 12 2020 openEuler Buildteam - 1.3.1-3 +- remove useless patch + +* Fri Sep 27 2019 openEuler Buildteam - 1.3.1-2 +- del unnecessary statement + +* Mon Sep 2 2019 openEuler Buildteam - 1.3.1-1 +- Package init diff --git a/libunwind.yaml b/libunwind.yaml new file mode 100644 index 00000000..75a741d9 --- /dev/null +++ b/libunwind.yaml @@ -0,0 +1,4 @@ +version_control: git +src_repo: https://git.savannah.gnu.org/git/libunwind.git +tag_prefix: ^v +seperator: . diff --git a/AUTHORS b/libunwind/AUTHORS similarity index 100% rename from AUTHORS rename to libunwind/AUTHORS diff --git a/COPYING b/libunwind/COPYING similarity index 100% rename from COPYING rename to libunwind/COPYING diff --git a/ChangeLog b/libunwind/ChangeLog similarity index 100% rename from ChangeLog rename to libunwind/ChangeLog diff --git a/Makefile.am b/libunwind/Makefile.am similarity index 100% rename from Makefile.am rename to libunwind/Makefile.am diff --git a/NEWS b/libunwind/NEWS similarity index 100% rename from NEWS rename to libunwind/NEWS diff --git a/libunwind/README b/libunwind/README new file mode 100644 index 00000000..9427144c --- /dev/null +++ b/libunwind/README @@ -0,0 +1,241 @@ +# libunwind + +[![Build Status](https://travis-ci.org/libunwind/libunwind.svg?branch=master)](https://travis-ci.org/libunwind/libunwind) + +This library supports several architecture/operating-system combinations: + +| System | Architecture | Status | +| :------ | :----------- | :----- | +| Linux | x86-64 | ✓ | +| Linux | x86 | ✓ | +| Linux | ARM | ✓ | +| Linux | AArch64 | ✓ | +| Linux | PPC32 | ✓ | +| Linux | PPC64 | ✓ | +| Linux | SuperH | ✓ | +| Linux | IA-64 | ✓ | +| Linux | PARISC | Works well, but C library missing unwind-info | +| Linux | Tilegx | 64-bit mode only | +| Linux | MIPS | Newly added | +| Linux | RISC-V | 64-bit only | +| HP-UX | IA-64 | Mostly works, but known to have serious limitations | +| FreeBSD | x86-64 | ✓ | +| FreeBSD | x86 | ✓ | +| FreeBSD | AArch64 | ✓ | +| Solaris | x86-64 | ✓ | + +## Libc Requirements + +libunwind depends on getcontext(), setcontext() functions which are missing +from C libraries like musl-libc because they are considered to be "obsolescent" +API by POSIX document. The following table tries to track current status of +such dependencies + + - r, requires + - p, provides its own implementation + - empty, no requirement + +| Architecture | getcontext | setcontext | +|--------------|------------|------------| +| aarch64 | p | | +| arm | p | | +| hppa | p | p | +| ia64 | p | r | +| mips | p | | +| ppc32 | r | | +| ppc64 | r | r | +| riscv | p | p | +| s390x | p | p | +| sh | r | | +| tilegx | r | r | +| x86 | p | r | +| x86_64 | p | p | + +## General Build Instructions + +In general, this library can be built and installed with the following +commands: + + $ autoreconf -i # Needed only for building from git. Depends on libtool. + $ ./configure + $ make + $ make install prefix=PREFIX + +where `PREFIX` is the installation prefix. By default, a prefix of +`/usr/local` is used, such that `libunwind.a` is installed in +`/usr/local/lib` and `unwind.h` is installed in `/usr/local/include`. For +testing, you may want to use a prefix of `/usr/local` instead. + + +### Building with Intel compiler + +#### Version 8 and later + +Starting with version 8, the preferred name for the IA-64 Intel +compiler is `icc` (same name as on x86). Thus, the configure-line +should look like this: + + $ ./configure CC=icc CFLAGS="-g -O3 -ip" CXX=icc CCAS=gcc CCASFLAGS=-g \ + LDFLAGS="-L$PWD/src/.libs" + + +### Building on HP-UX + +For the time being, libunwind must be built with GCC on HP-UX. + +libunwind should be configured and installed on HP-UX like this: + + $ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64" + +Caveat: Unwinding of 32-bit (ILP32) binaries is not supported at the moment. + +### Workaround for older versions of GCC + +GCC v3.0 and GCC v3.2 ship with a bad version of `sys/types.h`. The +workaround is to issue the following commands before running +`configure`: + + $ mkdir $top_dir/include/sys + $ cp /usr/include/sys/types.h $top_dir/include/sys + +GCC v3.3.2 or later have been fixed and do not require this +workaround. + +### Building for PowerPC64 / Linux + +For building for power64 you should use: + + $ ./configure CFLAGS="-g -O2 -m64" CXXFLAGS="-g -O2 -m64" + +If your power support altivec registers: + + $ ./configure CFLAGS="-g -O2 -m64 -maltivec" CXXFLAGS="-g -O2 -m64 -maltivec" + +To check if your processor has support for vector registers (altivec): + + cat /proc/cpuinfo | grep altivec + +and should have something like this: + + cpu : PPC970, altivec supported + +If libunwind seems to not work (backtracing failing), try to compile +it with `-O0`, without optimizations. There are some compiler problems +depending on the version of your gcc. + +### Building on FreeBSD + +General building instructions apply. To build and execute several tests +on older versions of FreeBSD, you need libexecinfo library available in +ports as devel/libexecinfo. This port has been removed as of 2017 and is +indeed no longer needed. + +## Regression Testing + +After building the library, you can run a set of regression tests with: + + $ make check + +### Expected results on IA-64 Linux + +Unless you have a very recent C library and compiler installed, it is +currently expected to have the following tests fail on IA-64 Linux: + +* `Gtest-init` (should pass starting with glibc-2.3.x/gcc-3.4) +* `Ltest-init` (should pass starting with glibc-2.3.x/gcc-3.4) +* `test-ptrace` (should pass starting with glibc-2.3.x/gcc-3.4) +* `run-ia64-test-dyn1` (should pass starting with glibc-2.3.x) + +This does not mean that libunwind cannot be used with older compilers +or C libraries, it just means that for certain corner cases, unwinding +will fail. Since they're corner cases, it is not likely for +applications to trigger them. + +Note: If you get lots of errors in `Gia64-test-nat` and `Lia64-test-nat`, it's +almost certainly a sign of an old assembler. The GNU assembler used +to encode previous-stack-pointer-relative offsets incorrectly. +This bug was fixed on 21-Sep-2004 so any later assembler will be +fine. + +### Expected results on x86 Linux + +The following tests are expected to fail on x86 Linux: + +* `test-ptrace` + +### Expected results on x86-64 Linux + +The following tests are expected to fail on x86-64 Linux: + +* `run-ptrace-misc` (see + and ) + +### Expected results on PARISC Linux + +Caveat: GCC v3.4 or newer is needed on PA-RISC Linux. Earlier +versions of the compiler failed to generate the exception-handling +program header (`GNU_EH_FRAME`) needed for unwinding. + +The following tests are expected to fail on x86-64 Linux: + +* `Gtest-bt` (backtrace truncated at `kill()` due to lack of unwind-info) +* `Ltest-bt` (likewise) +* `Gtest-resume-sig` (`Gresume.c:my_rt_sigreturn()` is wrong somehow) +* `Ltest-resume-sig` (likewise) +* `Gtest-init` (likewise) +* `Ltest-init` (likewise) +* `Gtest-dyn1` (no dynamic unwind info support yet) +* `Ltest-dyn1` (no dynamic unwind info support yet) +* `test-setjmp` (`longjmp()` not implemented yet) +* `run-check-namespace` (toolchain doesn't support `HIDDEN` yet) + +### Expected results on HP-UX + +`make check` is currently unsupported for HP-UX. You can try to run +it, but most tests will fail (and some may fail to terminate). The +only test programs that are known to work at this time are: + +* `tests/bt` +* `tests/Gperf-simple` +* `tests/test-proc-info` +* `tests/test-static-link` +* `tests/Gtest-init` +* `tests/Ltest-init` +* `tests/Gtest-resume-sig` +* `tests/Ltest-resume-sig` + +### Expected results on PPC64 Linux + +`make check` should run with no more than 10 out of 24 tests failed. + +### Expected results on Solaris x86-64 + +`make check` is passing 27 out of 33 tests. The following six tests are consistently +failing: + +* `Gtest-concurrent` +* `Ltest-concurrent` +* `Ltest-init-local-signal` +* `Lrs-race` +* `test-setjmp` +* `x64-unwind-badjmp-signal-frame` + +## Performance Testing + +This distribution includes a few simple performance tests which give +some idea of the basic cost of various libunwind operations. After +building the library, you can run these tests with the following +commands: + + $ cd tests + $ make perf + +## Contacting the Developers + +Please direct all questions regarding this library to . + +You can do this by sending an email to with +a body of "subscribe libunwind-devel", or you can subscribe and manage your +subscription via the web-interface at . + +You can also interact on our GitHub page: . diff --git a/TODO b/libunwind/TODO similarity index 100% rename from TODO rename to libunwind/TODO diff --git a/acinclude.m4 b/libunwind/acinclude.m4 similarity index 100% rename from acinclude.m4 rename to libunwind/acinclude.m4 diff --git a/configure.ac b/libunwind/configure.ac similarity index 98% rename from configure.ac rename to libunwind/configure.ac index 32d29d65..2893f0cf 100644 --- a/configure.ac +++ b/libunwind/configure.ac @@ -1,8 +1,8 @@ define(pkg_major, 1) define(pkg_minor, 6) -define(pkg_extra, -rc1) +define(pkg_extra, 2) define(pkg_maintainer, libunwind-devel@nongnu.org) -define(mkvers, $1.$2$3) +define(mkvers, $1.$2.$3) dnl Process this file with autoconf to produce a configure script. AC_INIT([libunwind],[mkvers(pkg_major, pkg_minor, pkg_extra)],[pkg_maintainer]) AC_CONFIG_SRCDIR(src/mi/backtrace.c) @@ -136,7 +136,7 @@ AC_MSG_RESULT([$enable_ptrace]) AC_ARG_ENABLE(setjmp, AS_HELP_STRING([--enable-setjmp],[building libunwind-setjmp library]),, - [AS_IF([test x$target_arch == x$host_arch], [enable_setjmp=yes], [enable_setjmp=no])] + [AS_IF([test x$target_arch = x$host_arch], [enable_setjmp=yes], [enable_setjmp=no])] ) AC_ARG_ENABLE(documentation, @@ -261,7 +261,7 @@ case "${target_arch}" in (aarch64) enable_debug_frame=yes;; (*) enable_debug_frame=no;; esac]) -if test x$remote_only == xyes; then +if test x$remote_only = xyes; then enable_debug_frame=no fi if test x$enable_debug_frame = xyes; then diff --git a/doc/Makefile.am b/libunwind/doc/Makefile.am similarity index 100% rename from doc/Makefile.am rename to libunwind/doc/Makefile.am diff --git a/doc/NOTES b/libunwind/doc/NOTES similarity index 100% rename from doc/NOTES rename to libunwind/doc/NOTES diff --git a/doc/_U_dyn_cancel.man b/libunwind/doc/_U_dyn_cancel.man similarity index 100% rename from doc/_U_dyn_cancel.man rename to libunwind/doc/_U_dyn_cancel.man diff --git a/doc/_U_dyn_cancel.tex b/libunwind/doc/_U_dyn_cancel.tex similarity index 100% rename from doc/_U_dyn_cancel.tex rename to libunwind/doc/_U_dyn_cancel.tex diff --git a/doc/_U_dyn_register.man b/libunwind/doc/_U_dyn_register.man similarity index 100% rename from doc/_U_dyn_register.man rename to libunwind/doc/_U_dyn_register.man diff --git a/doc/_U_dyn_register.tex b/libunwind/doc/_U_dyn_register.tex similarity index 100% rename from doc/_U_dyn_register.tex rename to libunwind/doc/_U_dyn_register.tex diff --git a/doc/common.tex.in b/libunwind/doc/common.tex.in similarity index 100% rename from doc/common.tex.in rename to libunwind/doc/common.tex.in diff --git a/doc/libunwind-dynamic.man b/libunwind/doc/libunwind-dynamic.man similarity index 100% rename from doc/libunwind-dynamic.man rename to libunwind/doc/libunwind-dynamic.man diff --git a/doc/libunwind-dynamic.tex b/libunwind/doc/libunwind-dynamic.tex similarity index 100% rename from doc/libunwind-dynamic.tex rename to libunwind/doc/libunwind-dynamic.tex diff --git a/doc/libunwind-ia64.man b/libunwind/doc/libunwind-ia64.man similarity index 100% rename from doc/libunwind-ia64.man rename to libunwind/doc/libunwind-ia64.man diff --git a/doc/libunwind-ia64.tex b/libunwind/doc/libunwind-ia64.tex similarity index 100% rename from doc/libunwind-ia64.tex rename to libunwind/doc/libunwind-ia64.tex diff --git a/doc/libunwind-ptrace.man b/libunwind/doc/libunwind-ptrace.man similarity index 100% rename from doc/libunwind-ptrace.man rename to libunwind/doc/libunwind-ptrace.man diff --git a/doc/libunwind-ptrace.tex b/libunwind/doc/libunwind-ptrace.tex similarity index 100% rename from doc/libunwind-ptrace.tex rename to libunwind/doc/libunwind-ptrace.tex diff --git a/doc/libunwind-setjmp.man b/libunwind/doc/libunwind-setjmp.man similarity index 100% rename from doc/libunwind-setjmp.man rename to libunwind/doc/libunwind-setjmp.man diff --git a/doc/libunwind-setjmp.tex b/libunwind/doc/libunwind-setjmp.tex similarity index 100% rename from doc/libunwind-setjmp.tex rename to libunwind/doc/libunwind-setjmp.tex diff --git a/doc/libunwind.man b/libunwind/doc/libunwind.man similarity index 100% rename from doc/libunwind.man rename to libunwind/doc/libunwind.man diff --git a/doc/libunwind.tex b/libunwind/doc/libunwind.tex similarity index 100% rename from doc/libunwind.tex rename to libunwind/doc/libunwind.tex diff --git a/doc/libunwind.trans b/libunwind/doc/libunwind.trans similarity index 100% rename from doc/libunwind.trans rename to libunwind/doc/libunwind.trans diff --git a/doc/unw_apply_reg_state.man b/libunwind/doc/unw_apply_reg_state.man similarity index 100% rename from doc/unw_apply_reg_state.man rename to libunwind/doc/unw_apply_reg_state.man diff --git a/doc/unw_apply_reg_state.tex b/libunwind/doc/unw_apply_reg_state.tex similarity index 100% rename from doc/unw_apply_reg_state.tex rename to libunwind/doc/unw_apply_reg_state.tex diff --git a/doc/unw_backtrace.man b/libunwind/doc/unw_backtrace.man similarity index 100% rename from doc/unw_backtrace.man rename to libunwind/doc/unw_backtrace.man diff --git a/doc/unw_backtrace.tex b/libunwind/doc/unw_backtrace.tex similarity index 100% rename from doc/unw_backtrace.tex rename to libunwind/doc/unw_backtrace.tex diff --git a/doc/unw_create_addr_space.man b/libunwind/doc/unw_create_addr_space.man similarity index 100% rename from doc/unw_create_addr_space.man rename to libunwind/doc/unw_create_addr_space.man diff --git a/doc/unw_create_addr_space.tex b/libunwind/doc/unw_create_addr_space.tex similarity index 100% rename from doc/unw_create_addr_space.tex rename to libunwind/doc/unw_create_addr_space.tex diff --git a/doc/unw_destroy_addr_space.man b/libunwind/doc/unw_destroy_addr_space.man similarity index 100% rename from doc/unw_destroy_addr_space.man rename to libunwind/doc/unw_destroy_addr_space.man diff --git a/doc/unw_destroy_addr_space.tex b/libunwind/doc/unw_destroy_addr_space.tex similarity index 100% rename from doc/unw_destroy_addr_space.tex rename to libunwind/doc/unw_destroy_addr_space.tex diff --git a/doc/unw_flush_cache.man b/libunwind/doc/unw_flush_cache.man similarity index 100% rename from doc/unw_flush_cache.man rename to libunwind/doc/unw_flush_cache.man diff --git a/doc/unw_flush_cache.tex b/libunwind/doc/unw_flush_cache.tex similarity index 100% rename from doc/unw_flush_cache.tex rename to libunwind/doc/unw_flush_cache.tex diff --git a/doc/unw_get_accessors.man b/libunwind/doc/unw_get_accessors.man similarity index 100% rename from doc/unw_get_accessors.man rename to libunwind/doc/unw_get_accessors.man diff --git a/doc/unw_get_accessors.tex b/libunwind/doc/unw_get_accessors.tex similarity index 100% rename from doc/unw_get_accessors.tex rename to libunwind/doc/unw_get_accessors.tex diff --git a/doc/unw_get_fpreg.man b/libunwind/doc/unw_get_fpreg.man similarity index 100% rename from doc/unw_get_fpreg.man rename to libunwind/doc/unw_get_fpreg.man diff --git a/doc/unw_get_fpreg.tex b/libunwind/doc/unw_get_fpreg.tex similarity index 100% rename from doc/unw_get_fpreg.tex rename to libunwind/doc/unw_get_fpreg.tex diff --git a/doc/unw_get_proc_info.man b/libunwind/doc/unw_get_proc_info.man similarity index 100% rename from doc/unw_get_proc_info.man rename to libunwind/doc/unw_get_proc_info.man diff --git a/doc/unw_get_proc_info.tex b/libunwind/doc/unw_get_proc_info.tex similarity index 100% rename from doc/unw_get_proc_info.tex rename to libunwind/doc/unw_get_proc_info.tex diff --git a/doc/unw_get_proc_info_by_ip.man b/libunwind/doc/unw_get_proc_info_by_ip.man similarity index 100% rename from doc/unw_get_proc_info_by_ip.man rename to libunwind/doc/unw_get_proc_info_by_ip.man diff --git a/doc/unw_get_proc_info_by_ip.tex b/libunwind/doc/unw_get_proc_info_by_ip.tex similarity index 100% rename from doc/unw_get_proc_info_by_ip.tex rename to libunwind/doc/unw_get_proc_info_by_ip.tex diff --git a/doc/unw_get_proc_name.man b/libunwind/doc/unw_get_proc_name.man similarity index 90% rename from doc/unw_get_proc_name.man rename to libunwind/doc/unw_get_proc_name.man index 8b2bd06e..9eb0086d 100644 --- a/doc/unw_get_proc_name.man +++ b/libunwind/doc/unw_get_proc_name.man @@ -1,5 +1,7 @@ +.\" *********************************** start of \input{common.tex} +.\" *********************************** end of \input{common.tex} '\" t -.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007 +.\" Manual page created with latex2man on Tue Nov 30 16:47:40 2021 .\" NOTE: This file is generated, DO NOT EDIT. .de Vb .ft CW @@ -10,7 +12,7 @@ .fi .. -.TH "UNW\\_GET\\_PROC\\_NAME" "3" "16 August 2007" "Programming Library " "Programming Library " +.TH "UNW\\_GET\\_PROC\\_NAME" "3" "30 November 2021" "Programming Library " "Programming Library " .SH NAME unw_get_proc_name \-\- get name of current procedure diff --git a/doc/unw_get_proc_name.tex b/libunwind/doc/unw_get_proc_name.tex similarity index 100% rename from doc/unw_get_proc_name.tex rename to libunwind/doc/unw_get_proc_name.tex diff --git a/doc/unw_get_reg.man b/libunwind/doc/unw_get_reg.man similarity index 100% rename from doc/unw_get_reg.man rename to libunwind/doc/unw_get_reg.man diff --git a/doc/unw_get_reg.tex b/libunwind/doc/unw_get_reg.tex similarity index 100% rename from doc/unw_get_reg.tex rename to libunwind/doc/unw_get_reg.tex diff --git a/doc/unw_getcontext.man b/libunwind/doc/unw_getcontext.man similarity index 100% rename from doc/unw_getcontext.man rename to libunwind/doc/unw_getcontext.man diff --git a/doc/unw_getcontext.tex b/libunwind/doc/unw_getcontext.tex similarity index 100% rename from doc/unw_getcontext.tex rename to libunwind/doc/unw_getcontext.tex diff --git a/doc/unw_init_local.man b/libunwind/doc/unw_init_local.man similarity index 100% rename from doc/unw_init_local.man rename to libunwind/doc/unw_init_local.man diff --git a/doc/unw_init_local.tex b/libunwind/doc/unw_init_local.tex similarity index 100% rename from doc/unw_init_local.tex rename to libunwind/doc/unw_init_local.tex diff --git a/doc/unw_init_local2.man b/libunwind/doc/unw_init_local2.man similarity index 100% rename from doc/unw_init_local2.man rename to libunwind/doc/unw_init_local2.man diff --git a/doc/unw_init_remote.man b/libunwind/doc/unw_init_remote.man similarity index 100% rename from doc/unw_init_remote.man rename to libunwind/doc/unw_init_remote.man diff --git a/doc/unw_init_remote.tex b/libunwind/doc/unw_init_remote.tex similarity index 100% rename from doc/unw_init_remote.tex rename to libunwind/doc/unw_init_remote.tex diff --git a/doc/unw_is_fpreg.man b/libunwind/doc/unw_is_fpreg.man similarity index 100% rename from doc/unw_is_fpreg.man rename to libunwind/doc/unw_is_fpreg.man diff --git a/doc/unw_is_fpreg.tex b/libunwind/doc/unw_is_fpreg.tex similarity index 100% rename from doc/unw_is_fpreg.tex rename to libunwind/doc/unw_is_fpreg.tex diff --git a/doc/unw_is_signal_frame.man b/libunwind/doc/unw_is_signal_frame.man similarity index 100% rename from doc/unw_is_signal_frame.man rename to libunwind/doc/unw_is_signal_frame.man diff --git a/doc/unw_is_signal_frame.tex b/libunwind/doc/unw_is_signal_frame.tex similarity index 100% rename from doc/unw_is_signal_frame.tex rename to libunwind/doc/unw_is_signal_frame.tex diff --git a/doc/unw_reg_states_iterate.man b/libunwind/doc/unw_reg_states_iterate.man similarity index 100% rename from doc/unw_reg_states_iterate.man rename to libunwind/doc/unw_reg_states_iterate.man diff --git a/doc/unw_reg_states_iterate.tex b/libunwind/doc/unw_reg_states_iterate.tex similarity index 100% rename from doc/unw_reg_states_iterate.tex rename to libunwind/doc/unw_reg_states_iterate.tex diff --git a/doc/unw_regname.man b/libunwind/doc/unw_regname.man similarity index 100% rename from doc/unw_regname.man rename to libunwind/doc/unw_regname.man diff --git a/doc/unw_regname.tex b/libunwind/doc/unw_regname.tex similarity index 100% rename from doc/unw_regname.tex rename to libunwind/doc/unw_regname.tex diff --git a/doc/unw_resume.man b/libunwind/doc/unw_resume.man similarity index 100% rename from doc/unw_resume.man rename to libunwind/doc/unw_resume.man diff --git a/doc/unw_resume.tex b/libunwind/doc/unw_resume.tex similarity index 100% rename from doc/unw_resume.tex rename to libunwind/doc/unw_resume.tex diff --git a/doc/unw_set_cache_size.man b/libunwind/doc/unw_set_cache_size.man similarity index 100% rename from doc/unw_set_cache_size.man rename to libunwind/doc/unw_set_cache_size.man diff --git a/doc/unw_set_cache_size.tex b/libunwind/doc/unw_set_cache_size.tex similarity index 100% rename from doc/unw_set_cache_size.tex rename to libunwind/doc/unw_set_cache_size.tex diff --git a/doc/unw_set_caching_policy.man b/libunwind/doc/unw_set_caching_policy.man similarity index 100% rename from doc/unw_set_caching_policy.man rename to libunwind/doc/unw_set_caching_policy.man diff --git a/doc/unw_set_caching_policy.tex b/libunwind/doc/unw_set_caching_policy.tex similarity index 100% rename from doc/unw_set_caching_policy.tex rename to libunwind/doc/unw_set_caching_policy.tex diff --git a/doc/unw_set_fpreg.man b/libunwind/doc/unw_set_fpreg.man similarity index 100% rename from doc/unw_set_fpreg.man rename to libunwind/doc/unw_set_fpreg.man diff --git a/doc/unw_set_fpreg.tex b/libunwind/doc/unw_set_fpreg.tex similarity index 100% rename from doc/unw_set_fpreg.tex rename to libunwind/doc/unw_set_fpreg.tex diff --git a/doc/unw_set_reg.man b/libunwind/doc/unw_set_reg.man similarity index 100% rename from doc/unw_set_reg.man rename to libunwind/doc/unw_set_reg.man diff --git a/doc/unw_set_reg.tex b/libunwind/doc/unw_set_reg.tex similarity index 100% rename from doc/unw_set_reg.tex rename to libunwind/doc/unw_set_reg.tex diff --git a/doc/unw_step.man b/libunwind/doc/unw_step.man similarity index 100% rename from doc/unw_step.man rename to libunwind/doc/unw_step.man diff --git a/doc/unw_step.tex b/libunwind/doc/unw_step.tex similarity index 100% rename from doc/unw_step.tex rename to libunwind/doc/unw_step.tex diff --git a/doc/unw_strerror.man b/libunwind/doc/unw_strerror.man similarity index 100% rename from doc/unw_strerror.man rename to libunwind/doc/unw_strerror.man diff --git a/doc/unw_strerror.tex b/libunwind/doc/unw_strerror.tex similarity index 100% rename from doc/unw_strerror.tex rename to libunwind/doc/unw_strerror.tex diff --git a/include/compiler.h b/libunwind/include/compiler.h similarity index 100% rename from include/compiler.h rename to libunwind/include/compiler.h diff --git a/include/config.h b/libunwind/include/config.h similarity index 84% rename from include/config.h rename to libunwind/include/config.h index af65f7ce..66881bbf 100644 --- a/include/config.h +++ b/libunwind/include/config.h @@ -2,38 +2,26 @@ /* include/config.h.in. Generated from configure.ac by autoheader. */ /* Block signals before mutex operations */ -/* #undef CONFIG_BLOCK_SIGNALS */ +#define CONFIG_BLOCK_SIGNALS /**/ /* Enable Debug Frame */ -#ifndef UNW_REMOTE_ONLY -/* -from configure.ac - -if remote build then enable_debug_frame will be no - -if test x$remote_only == xyes; then - enable_debug_frame=no -fi -if test x$enable_debug_frame = xyes; then - AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame]) -fi - -*/ -#define CONFIG_DEBUG_FRAME 1 -#endif +/* #undef CONFIG_DEBUG_FRAME */ /* Support for Microsoft ABI extensions */ /* #undef CONFIG_MSABI_SUPPORT */ +/* Define if the weak 'backtrace' symbol is provided. */ +#define CONFIG_WEAK_BACKTRACE 1 + /* Define to 1 if you want every memory access validated */ #define CONSERVATIVE_CHECKS 1 +/* Define to 1 if you have the header file. */ +#define HAVE_ASM_PTRACE_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_ASM_PTRACE_OFFSETS_H */ -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ATOMIC_OPS_H */ - /* Define to 1 if you have the header file. */ #define HAVE_BYTESWAP_H 1 @@ -67,7 +55,7 @@ fi /* Define to 1 if you have the declaration of `PT_CONTINUE', and to 0 if you don't. */ -#define HAVE_DECL_PT_CONTINUE 0 +#define HAVE_DECL_PT_CONTINUE 1 /* Define to 1 if you have the declaration of `PT_GETFPREGS', and to 0 if you don't. */ @@ -75,7 +63,7 @@ fi /* Define to 1 if you have the declaration of `PT_GETREGS', and to 0 if you don't. */ -#define HAVE_DECL_PT_GETREGS 0 +#define HAVE_DECL_PT_GETREGS 1 /* Define to 1 if you have the declaration of `PT_IO', and to 0 if you don't. */ @@ -112,7 +100,7 @@ fi #define HAVE_ENDIAN_H 1 /* Define to 1 if you have the header file. */ -/* #undef HAVE_EXECINFO_H */ +#define HAVE_EXECINFO_H 1 /* Define to 1 if you have the `getunwind' function. */ /* #undef HAVE_GETUNWIND */ @@ -136,7 +124,10 @@ fi #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mincore' function. */ -/* #undef HAVE_MINCORE */ +#define HAVE_MINCORE 1 + +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 @@ -154,28 +145,28 @@ fi #define HAVE_STRING_H 1 /* Define to 1 if `dlpi_subs' is a member of `struct dl_phdr_info'. */ -/* #undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS */ +#define HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS 1 /* Define to 1 if the system has the type `struct elf_prstatus'. */ -/* #undef HAVE_STRUCT_ELF_PRSTATUS */ +#define HAVE_STRUCT_ELF_PRSTATUS 1 /* Define to 1 if the system has the type `struct prstatus'. */ /* #undef HAVE_STRUCT_PRSTATUS */ -/* Defined if __sync atomics are available */ -#define HAVE_SYNC_ATOMICS 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_ELF_H */ /* Define to 1 if you have the header file. */ -#define HAVE_SYS_ENDIAN_H 1 +/* #undef HAVE_SYS_ENDIAN_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_LINK_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_PROCFS_H */ +#define HAVE_SYS_PROCFS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PTRACE_H 1 @@ -183,6 +174,9 @@ fi /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCALL_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 @@ -201,16 +195,12 @@ fi /* Defined if __builtin___clear_cache() is available */ #define HAVE__BUILTIN___CLEAR_CACHE 1 -/* Define to 1 if __thread keyword is supported by the C compiler. */ -#define HAVE___THREAD 1 +/* Define to 1 if --enable-per-thread-cache */ +/* #undef HAVE___CACHE_PER_THREAD */ -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -/* #undef NO_MINUS_C_MINUS_O */ - /* Name of package */ #define PACKAGE "libunwind" @@ -221,7 +211,7 @@ fi #define PACKAGE_NAME "libunwind" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libunwind 1.3.1" +#define PACKAGE_STRING "libunwind 1.6.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libunwind" @@ -230,16 +220,16 @@ fi #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.3.1" +#define PACKAGE_VERSION "1.6.2" /* The size of `off_t', as computed by sizeof. */ -#define SIZEOF_OFF_T 4 +#define SIZEOF_OFF_T 8 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.3.1" +#define VERSION "1.6.2" /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/libunwind/include/config.h.in b/libunwind/include/config.h.in new file mode 100644 index 00000000..9fe8d123 --- /dev/null +++ b/libunwind/include/config.h.in @@ -0,0 +1,246 @@ +/* include/config.h.in. Generated from configure.ac by autoheader. */ + +/* Block signals before mutex operations */ +#undef CONFIG_BLOCK_SIGNALS + +/* Enable Debug Frame */ +#undef CONFIG_DEBUG_FRAME + +/* Support for Microsoft ABI extensions */ +#undef CONFIG_MSABI_SUPPORT + +/* Define if the weak 'backtrace' symbol is provided. */ +#undef CONFIG_WEAK_BACKTRACE + +/* Define to 1 if you want every memory access validated */ +#undef CONSERVATIVE_CHECKS + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_PTRACE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_PTRACE_OFFSETS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define to 1 if you have the declaration of `PTRACE_CONT', and to 0 if you + don't. */ +#undef HAVE_DECL_PTRACE_CONT + +/* Define to 1 if you have the declaration of `PTRACE_POKEDATA', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_POKEDATA + +/* Define to 1 if you have the declaration of `PTRACE_POKEUSER', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_POKEUSER + +/* Define to 1 if you have the declaration of `PTRACE_SETREGSET', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SETREGSET + +/* Define to 1 if you have the declaration of `PTRACE_SINGLESTEP', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SINGLESTEP + +/* Define to 1 if you have the declaration of `PTRACE_SYSCALL', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SYSCALL + +/* Define to 1 if you have the declaration of `PTRACE_TRACEME', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_TRACEME + +/* Define to 1 if you have the declaration of `PT_CONTINUE', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_CONTINUE + +/* Define to 1 if you have the declaration of `PT_GETFPREGS', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_GETFPREGS + +/* Define to 1 if you have the declaration of `PT_GETREGS', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_GETREGS + +/* Define to 1 if you have the declaration of `PT_IO', and to 0 if you don't. + */ +#undef HAVE_DECL_PT_IO + +/* Define to 1 if you have the declaration of `PT_STEP', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_STEP + +/* Define to 1 if you have the declaration of `PT_SYSCALL', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_SYSCALL + +/* Define to 1 if you have the declaration of `PT_TRACE_ME', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_TRACE_ME + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `dlmodinfo' function. */ +#undef HAVE_DLMODINFO + +/* Define to 1 if you have the `dl_iterate_phdr' function. */ +#undef HAVE_DL_ITERATE_PHDR + +/* Define to 1 if you have the `dl_phdr_removals_counter' function. */ +#undef HAVE_DL_PHDR_REMOVALS_COUNTER + +/* Define to 1 if you have the header file. */ +#undef HAVE_ELF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + +/* Define to 1 if you have the `getunwind' function. */ +#undef HAVE_GETUNWIND + +/* Define to 1 if you have the header file. */ +#undef HAVE_IA64INTRIN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `uca' library (-luca). */ +#undef HAVE_LIBUCA + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINK_H + +/* Define if you have liblzma */ +#undef HAVE_LZMA + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mincore' function. */ +#undef HAVE_MINCORE + +/* Define to 1 if you have the `pipe2' function. */ +#undef HAVE_PIPE2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if `dlpi_subs' is a member of `struct dl_phdr_info'. */ +#undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS + +/* Define to 1 if the system has the type `struct elf_prstatus'. */ +#undef HAVE_STRUCT_ELF_PRSTATUS + +/* Define to 1 if the system has the type `struct prstatus'. */ +#undef HAVE_STRUCT_PRSTATUS + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ELF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_LINK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PROCFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PTRACE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UC_ACCESS_H + +/* Define to 1 if you have the `ttrace' function. */ +#undef HAVE_TTRACE + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have libz */ +#undef HAVE_ZLIB + +/* Defined if __builtin_unreachable() is available */ +#undef HAVE__BUILTIN_UNREACHABLE + +/* Defined if __builtin___clear_cache() is available */ +#undef HAVE__BUILTIN___CLEAR_CACHE + +/* Define to 1 if --enable-per-thread-cache */ +#undef HAVE___CACHE_PER_THREAD + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/include/dwarf-eh.h b/libunwind/include/dwarf-eh.h similarity index 100% rename from include/dwarf-eh.h rename to libunwind/include/dwarf-eh.h diff --git a/include/dwarf.h b/libunwind/include/dwarf.h similarity index 95% rename from include/dwarf.h rename to libunwind/include/dwarf.h index 6576997b..175c419b 100644 --- a/include/dwarf.h +++ b/libunwind/include/dwarf.h @@ -31,8 +31,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ struct dwarf_cursor; /* forward-declaration */ struct elf_dyn_info; -struct elf_image; -struct map_info; #include "dwarf-config.h" @@ -172,8 +170,6 @@ typedef enum DW_CFA_offset_extended_sf = 0x11, DW_CFA_def_cfa_sf = 0x12, DW_CFA_def_cfa_offset_sf = 0x13, - DW_CFA_val_offset = 0x14, - DW_CFA_val_offset_sf = 0x15, DW_CFA_val_expression = 0x16, DW_CFA_lo_user = 0x1c, DW_CFA_MIPS_advance_loc8 = 0x1d, @@ -235,7 +231,6 @@ typedef enum DWARF_WHERE_REG, /* register saved in another register */ DWARF_WHERE_EXPR, /* register saved */ DWARF_WHERE_VAL_EXPR, /* register has computed value */ - DWARF_WHERE_VAL, /* register that is the value */ } dwarf_where_t; @@ -334,14 +329,6 @@ typedef struct dwarf_cursor short hint; /* faster lookup of the rs cache */ short prev_rs; - unw_word_t rel_pc; /* pc related to the beginning of the elf, used for addr2line */ - unw_word_t cached_ip; /* cached instruction pointer */ - struct map_info *cached_map; /* memory mapping info associated with cached ip */ - // allow us set unwind context - int index; - int reg_sz; - unw_word_t ctx[DWARF_NUM_PRESERVED_REGS]; - unw_word_t fp; /* frame-pointer */ } dwarf_cursor_t; @@ -432,12 +419,10 @@ extern int dwarf_search_unwind_table (unw_addr_space_t as, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); -/* Add For Cache MAP And ELF */ -extern int dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, - unw_addr_space_t as, char *path, - unw_word_t segbase, unw_word_t mapoff, - unw_word_t ip); -/* Add For Cache MAP And ELF */ + +extern int dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as, + char *path, unw_word_t segbase, unw_word_t mapoff, + unw_word_t ip); extern void dwarf_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg); extern int dwarf_eval_expr (struct dwarf_cursor *c, unw_word_t stack_val, unw_word_t *addr, diff --git a/include/dwarf_i.h b/libunwind/include/dwarf_i.h similarity index 99% rename from include/dwarf_i.h rename to libunwind/include/dwarf_i.h index 58f80340..b3e4c1b4 100644 --- a/include/dwarf_i.h +++ b/libunwind/include/dwarf_i.h @@ -136,7 +136,7 @@ static inline int dwarf_readu8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, uint8_t *valp, void *arg) { - unw_word_t val, aligned_addr = *addr & (~sizeof (unw_word_t) + 1); + unw_word_t val, aligned_addr = *addr & -sizeof (unw_word_t); unw_word_t off = *addr - aligned_addr; int ret; diff --git a/include/libunwind-aarch64.h b/libunwind/include/libunwind-aarch64.h similarity index 95% rename from include/libunwind-aarch64.h rename to libunwind/include/libunwind-aarch64.h index 1ea596c7..a5265c46 100644 --- a/include/libunwind-aarch64.h +++ b/libunwind/include/libunwind-aarch64.h @@ -37,7 +37,11 @@ extern "C" { #include #ifndef UNW_EMPTY_STRUCT -# define UNW_EMPTY_STRUCT uint8_t unused; +# ifdef __GNUC__ +# define UNW_EMPTY_STRUCT +# else +# define UNW_EMPTY_STRUCT uint8_t unused; +# endif #endif #define UNW_TARGET aarch64 @@ -55,7 +59,7 @@ extern "C" { cursor) + padding */ -#define UNW_TDEP_CURSOR_LEN 1024 +#define UNW_TDEP_CURSOR_LEN 250 typedef uint64_t unw_word_t; typedef int64_t unw_sword_t; @@ -119,9 +123,6 @@ typedef enum UNW_AARCH64_PC, UNW_AARCH64_PSTATE, - /* Pseudo-register */ - UNW_AARCH64_RA_SIGN_STATE = 34, - /* 128-bit FP/Advanced SIMD registers. */ UNW_AARCH64_V0 = 64, UNW_AARCH64_V1, @@ -167,7 +168,7 @@ typedef enum UNW_TDEP_IP = UNW_AARCH64_X30, UNW_TDEP_SP = UNW_AARCH64_SP, - UNW_TDEP_EH = UNW_AARCH64_X0 + UNW_TDEP_EH = UNW_AARCH64_X0, } aarch64_regnum_t; @@ -231,11 +232,9 @@ typedef ucontext_t unw_tdep_context_t; #include "libunwind-common.h" #include "libunwind-dynamic.h" -#define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs; - #define unw_tdep_getcontext(uc) ({ \ unw_tdep_context_t *unw_ctx = (uc); \ - UNW_BASE \ + register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs; \ __asm__ __volatile__ ( \ "stp x0, x1, [%[base], #0]\n" \ "stp x2, x3, [%[base], #16]\n" \ @@ -244,7 +243,7 @@ typedef ucontext_t unw_tdep_context_t; "stp x8, x9, [%[base], #64]\n" \ "stp x10, x11, [%[base], #80]\n" \ "stp x12, x13, [%[base], #96]\n" \ - "stp x14, x15, [%[base], #112]\n" \ + "stp x14, x13, [%[base], #112]\n" \ "stp x16, x17, [%[base], #128]\n" \ "stp x18, x19, [%[base], #144]\n" \ "stp x20, x21, [%[base], #160]\n" \ diff --git a/include/libunwind-arm.h b/libunwind/include/libunwind-arm.h similarity index 97% rename from include/libunwind-arm.h rename to libunwind/include/libunwind-arm.h index 8896601e..0bea7958 100644 --- a/include/libunwind-arm.h +++ b/libunwind/include/libunwind-arm.h @@ -33,7 +33,11 @@ extern "C" { #include #ifndef UNW_EMPTY_STRUCT -# define UNW_EMPTY_STRUCT uint8_t unused; +# ifdef __GNUC__ +# define UNW_EMPTY_STRUCT +# else +# define UNW_EMPTY_STRUCT uint8_t unused; +# endif #endif #define UNW_TARGET arm @@ -46,7 +50,7 @@ extern "C" { require recompiling all users of this library. Stack allocation is relatively cheap and unwind-state copying is relatively rare, so we want to err on making it rather too big than too small. */ - + /* FIXME for ARM. Too big? What do other things use for similar tasks? */ #define UNW_TDEP_CURSOR_LEN 4096 @@ -73,7 +77,7 @@ typedef enum UNW_ARM_R13, UNW_ARM_R14, UNW_ARM_R15, - + /* VFPv2 s0-s31 (obsolescent numberings). */ UNW_ARM_S0 = 64, UNW_ARM_S1, @@ -107,7 +111,7 @@ typedef enum UNW_ARM_S29, UNW_ARM_S30, UNW_ARM_S31, - + /* FPA register numberings. */ UNW_ARM_F0 = 96, UNW_ARM_F1, @@ -117,7 +121,7 @@ typedef enum UNW_ARM_F5, UNW_ARM_F6, UNW_ARM_F7, - + /* iWMMXt GR register numberings. */ UNW_ARM_wCGR0 = 104, UNW_ARM_wCGR1, @@ -127,7 +131,7 @@ typedef enum UNW_ARM_wCGR5, UNW_ARM_wCGR6, UNW_ARM_wCGR7, - + /* iWMMXt register numberings. */ UNW_ARM_wR0 = 112, UNW_ARM_wR1, @@ -145,9 +149,9 @@ typedef enum UNW_ARM_wR13, UNW_ARM_wR14, UNW_ARM_wR15, - + /* Two-byte encodings from here on. */ - + /* SPSR. */ UNW_ARM_SPSR = 128, UNW_ARM_SPSR_FIQ, @@ -155,7 +159,7 @@ typedef enum UNW_ARM_SPSR_ABT, UNW_ARM_SPSR_UND, UNW_ARM_SPSR_SVC, - + /* User mode registers. */ UNW_ARM_R8_USR = 144, UNW_ARM_R9_USR, @@ -164,7 +168,7 @@ typedef enum UNW_ARM_R12_USR, UNW_ARM_R13_USR, UNW_ARM_R14_USR, - + /* FIQ registers. */ UNW_ARM_R8_FIQ = 151, UNW_ARM_R9_FIQ, @@ -173,23 +177,23 @@ typedef enum UNW_ARM_R12_FIQ, UNW_ARM_R13_FIQ, UNW_ARM_R14_FIQ, - + /* IRQ registers. */ UNW_ARM_R13_IRQ = 158, UNW_ARM_R14_IRQ, - + /* ABT registers. */ UNW_ARM_R13_ABT = 160, UNW_ARM_R14_ABT, - + /* UND registers. */ UNW_ARM_R13_UND = 162, UNW_ARM_R14_UND, - + /* SVC registers. */ UNW_ARM_R13_SVC = 164, UNW_ARM_R14_SVC, - + /* iWMMXt control registers. */ UNW_ARM_wC0 = 192, UNW_ARM_wC1, diff --git a/libunwind/include/libunwind-common.h b/libunwind/include/libunwind-common.h new file mode 100644 index 00000000..9de37c1d --- /dev/null +++ b/libunwind/include/libunwind-common.h @@ -0,0 +1,292 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#define UNW_VERSION_MAJOR 1 +#define UNW_VERSION_MINOR 6 +#define UNW_VERSION_EXTRA 2 + +#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min)) +#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR) + +#ifdef __sun +// On SmartOS, gcc fails with the following error: +// +// ../include/libunwind-common.h:43:41: error: expected identifier or '(' before numeric constant +// # define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_) +// ^ +// +// workaround is to undefine _U explicitly. +// see https://github.com/libunwind/libunwind/issues/118 for more details. +// +#undef _U +#endif + +#define UNW_PASTE2(x,y) x##y +#define UNW_PASTE(x,y) UNW_PASTE2(x,y) +#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn) +#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn) + +#ifdef UNW_LOCAL_ONLY +# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_) +#else /* !UNW_LOCAL_ONLY */ +# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_) +#endif /* !UNW_LOCAL_ONLY */ + +/* Error codes. The unwind routines return the *negated* values of + these error codes on error and a non-negative value on success. */ +typedef enum + { + UNW_ESUCCESS = 0, /* no error */ + UNW_EUNSPEC, /* unspecified (general) error */ + UNW_ENOMEM, /* out of memory */ + UNW_EBADREG, /* bad register number */ + UNW_EREADONLYREG, /* attempt to write read-only register */ + UNW_ESTOPUNWIND, /* stop unwinding */ + UNW_EINVALIDIP, /* invalid IP */ + UNW_EBADFRAME, /* bad frame */ + UNW_EINVAL, /* unsupported operation or bad value */ + UNW_EBADVERSION, /* unwind info has unsupported version */ + UNW_ENOINFO /* no unwind info found */ + } +unw_error_t; + +/* The following enum defines the indices for a couple of + (pseudo-)registers which have the same meaning across all + platforms. (RO) means read-only. (RW) means read-write. General + registers (aka "integer registers") are expected to start with + index 0. The number of such registers is architecture-dependent. + The remaining indices can be used as an architecture sees fit. The + last valid register index is given by UNW_REG_LAST. */ +typedef enum + { + UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */ + UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */ + UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */ + UNW_REG_LAST = UNW_TDEP_LAST_REG + } +unw_frame_regnum_t; + +/* Number of exception-handler argument registers: */ +#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS + +typedef enum + { + UNW_CACHE_NONE, /* no caching */ + UNW_CACHE_GLOBAL, /* shared global cache */ + UNW_CACHE_PER_THREAD /* per-thread caching */ + } +unw_caching_policy_t; + +typedef enum + { + UNW_INIT_SIGNAL_FRAME = 1, /* We know this is a signal frame */ + } +unw_init_local2_flags_t; + +typedef int unw_regnum_t; + +/* The unwind cursor starts at the youngest (most deeply nested) frame + and is used to track the frame state as the unwinder steps from + frame to frame. It is safe to make (shallow) copies of variables + of this type. */ +typedef struct unw_cursor + { + unw_word_t opaque[UNW_TDEP_CURSOR_LEN]; + } +unw_cursor_t; + +/* This type encapsulates the entire (preserved) machine-state. */ +typedef unw_tdep_context_t unw_context_t; + +/* unw_getcontext() fills the unw_context_t pointed to by UC with the + machine state as it exists at the call-site. For implementation + reasons, this needs to be a target-dependent macro. It's easiest + to think of unw_getcontext() as being identical to getcontext(). */ +#define unw_getcontext(uc) unw_tdep_getcontext(uc) + +/* Return 1 if register number R is a floating-point register, zero + otherwise. + This routine is signal-safe. */ +#define unw_is_fpreg(r) unw_tdep_is_fpreg(r) + +typedef unw_tdep_fpreg_t unw_fpreg_t; + +typedef struct unw_addr_space *unw_addr_space_t; + +/* Each target may define it's own set of flags, but bits 0-15 are + reserved for general libunwind-use. */ +#define UNW_PI_FLAG_FIRST_TDEP_BIT 16 +/* The information comes from a .debug_frame section. */ +#define UNW_PI_FLAG_DEBUG_FRAME 32 + +typedef struct unw_proc_info + { + unw_word_t start_ip; /* first IP covered by this procedure */ + unw_word_t end_ip; /* first IP NOT covered by this procedure */ +#if defined(NEED_LAST_IP) + unw_word_t last_ip; /* first IP that could begin another procedure */ +#endif + unw_word_t lsda; /* address of lang.-spec. data area (if any) */ + unw_word_t handler; /* optional personality routine */ + unw_word_t gp; /* global-pointer value for this procedure */ + unw_word_t flags; /* misc. flags */ + + int format; /* unwind-info format (arch-specific) */ + int unwind_info_size; /* size of the information (if applicable) */ + void *unwind_info; /* unwind-info (arch-specific) */ + unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */ + } +unw_proc_info_t; + +typedef int (*unw_reg_states_callback)(void *token, + void *reg_states_data, + size_t reg_states_data_size, + unw_word_t start_ip, unw_word_t end_ip); + +/* These are backend callback routines that provide access to the + state of a "remote" process. This can be used, for example, to + unwind another process through the ptrace() interface. */ +typedef struct unw_accessors + { + /* Look up the unwind info associated with instruction-pointer IP. + On success, the routine fills in the PROC_INFO structure. */ + int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *, + int, void *); + + /* Release any resources (e.g., memory) that were allocated for + the unwind info returned in by a previous call to + find_proc_info() with NEED_UNWIND_INFO set to 1. */ + void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *); + + /* Return the list-head of the dynamically registered unwind + info. */ + int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *); + + /* Access aligned word at address ADDR. The value is returned + according to the endianness of the host (e.g., if the host is + little-endian and the target is big-endian, access_mem() needs + to byte-swap the value before returning it). */ + int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int, + void *); + + /* Access register number REG at address ADDR. */ + int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int, + void *); + + /* Access register number REG at address ADDR. */ + int (*access_fpreg) (unw_addr_space_t, unw_regnum_t, + unw_fpreg_t *, int, void *); + + int (*resume) (unw_addr_space_t, unw_cursor_t *, void *); + + /* Optional call back to obtain the name of a (static) procedure. + Dynamically generated procedures are handled automatically by + libunwind. This callback is optional and may be set to + NULL. */ + int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); + } +unw_accessors_t; + +typedef enum unw_save_loc_type + { + UNW_SLT_NONE, /* register is not saved ("not an l-value") */ + UNW_SLT_MEMORY, /* register has been saved in memory */ + UNW_SLT_REG /* register has been saved in (another) register */ + } +unw_save_loc_type_t; + +typedef struct unw_save_loc + { + unw_save_loc_type_t type; + union + { + unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */ + unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */ + } + u; + unw_tdep_save_loc_t extra; /* target-dependent additional information */ + } +unw_save_loc_t; + +/* These routines work both for local and remote unwinding. */ + +#define unw_local_addr_space UNW_OBJ(local_addr_space) +#define unw_create_addr_space UNW_OBJ(create_addr_space) +#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space) +#define unw_get_accessors UNW_ARCH_OBJ(get_accessors) +#define unw_get_accessors_int UNW_ARCH_OBJ(get_accessors_int) +#define unw_init_local UNW_OBJ(init_local) +#define unw_init_local2 UNW_OBJ(init_local2) +#define unw_init_remote UNW_OBJ(init_remote) +#define unw_step UNW_OBJ(step) +#define unw_resume UNW_OBJ(resume) +#define unw_get_proc_info UNW_OBJ(get_proc_info) +#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip) +#define unw_reg_states_iterate UNW_OBJ(reg_states_iterate) +#define unw_apply_reg_state UNW_OBJ(apply_reg_state) +#define unw_get_reg UNW_OBJ(get_reg) +#define unw_set_reg UNW_OBJ(set_reg) +#define unw_get_fpreg UNW_OBJ(get_fpreg) +#define unw_set_fpreg UNW_OBJ(set_fpreg) +#define unw_get_save_loc UNW_OBJ(get_save_loc) +#define unw_is_signal_frame UNW_OBJ(is_signal_frame) +#define unw_get_proc_name UNW_OBJ(get_proc_name) +#define unw_set_caching_policy UNW_OBJ(set_caching_policy) +#define unw_set_cache_size UNW_OBJ(set_cache_size) +#define unw_regname UNW_ARCH_OBJ(regname) +#define unw_flush_cache UNW_ARCH_OBJ(flush_cache) +#define unw_strerror UNW_ARCH_OBJ(strerror) + +extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int); +extern void unw_destroy_addr_space (unw_addr_space_t); +extern unw_accessors_t *unw_get_accessors (unw_addr_space_t); +extern unw_accessors_t *unw_get_accessors_int (unw_addr_space_t); +extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t); +extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t); +extern int unw_set_cache_size (unw_addr_space_t, size_t, int); +extern const char *unw_regname (unw_regnum_t); + +extern int unw_init_local (unw_cursor_t *, unw_context_t *); +extern int unw_init_local2 (unw_cursor_t *, unw_context_t *, int); +extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *); +extern int unw_step (unw_cursor_t *); +extern int unw_resume (unw_cursor_t *); +extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *); +extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t, + unw_proc_info_t *, void *); +extern int unw_reg_states_iterate (unw_cursor_t *, unw_reg_states_callback, void *); +extern int unw_apply_reg_state (unw_cursor_t *, void *); +extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *); +extern int unw_set_reg (unw_cursor_t *, int, unw_word_t); +extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *); +extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t); +extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *); +extern int unw_is_signal_frame (unw_cursor_t *); +extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *); +extern const char *unw_strerror (int); +extern int unw_backtrace (void **, int); + +extern unw_addr_space_t unw_local_addr_space; diff --git a/include/libunwind-common.h.in b/libunwind/include/libunwind-common.h.in similarity index 93% rename from include/libunwind-common.h.in rename to libunwind/include/libunwind-common.h.in index 742c7402..9dbb415f 100644 --- a/include/libunwind-common.h.in +++ b/libunwind/include/libunwind-common.h.in @@ -101,7 +101,7 @@ unw_caching_policy_t; typedef enum { - UNW_INIT_SIGNAL_FRAME = 1 /* We know this is a signal frame */ + UNW_INIT_SIGNAL_FRAME = 1, /* We know this is a signal frame */ } unw_init_local2_flags_t; @@ -207,24 +207,6 @@ typedef struct unw_accessors NULL. */ int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t, unw_word_t *, void *); - - /* Optional call back to return a mask to be used with pointer - * authentication on arm64. - * - * The on bits in the returned mask indicate which bits in a return address - * are part of a pointer authentication code. These are the bits in the - * return address to turn off so that the calling frame can be found - * for the unwinding to continue. - * - * The return value must be host-endian. e.g. if the target is big-endian - * and the host is little endian, the implementation of this function - * must byte swap. - * - * This callback is optional and may be set to NULL. In this case all - * the bits in the return address are used, as if no masking were done. - */ - unw_word_t (*ptrauth_insn_mask) (unw_addr_space_t, void *); - } unw_accessors_t; diff --git a/include/libunwind-coredump.h b/libunwind/include/libunwind-coredump.h similarity index 100% rename from include/libunwind-coredump.h rename to libunwind/include/libunwind-coredump.h diff --git a/include/libunwind-dynamic.h b/libunwind/include/libunwind-dynamic.h similarity index 99% rename from include/libunwind-dynamic.h rename to libunwind/include/libunwind-dynamic.h index a26f2c99..dc31b12e 100644 --- a/include/libunwind-dynamic.h +++ b/libunwind/include/libunwind-dynamic.h @@ -77,7 +77,7 @@ typedef enum UNW_INFO_FORMAT_TABLE, /* unw_dyn_table_t */ UNW_INFO_FORMAT_REMOTE_TABLE, /* unw_dyn_remote_table_t */ UNW_INFO_FORMAT_ARM_EXIDX, /* ARM specific unwind info */ - UNW_INFO_FORMAT_IP_OFFSET /* Like UNW_INFO_FORMAT_REMOTE_TABLE, but + UNW_INFO_FORMAT_IP_OFFSET, /* Like UNW_INFO_FORMAT_REMOTE_TABLE, but table entries are considered relative to di->start_ip, rather than di->segbase */ diff --git a/include/libunwind-hppa.h b/libunwind/include/libunwind-hppa.h similarity index 100% rename from include/libunwind-hppa.h rename to libunwind/include/libunwind-hppa.h diff --git a/include/libunwind-ia64.h b/libunwind/include/libunwind-ia64.h similarity index 100% rename from include/libunwind-ia64.h rename to libunwind/include/libunwind-ia64.h diff --git a/include/libunwind-mips.h b/libunwind/include/libunwind-mips.h similarity index 100% rename from include/libunwind-mips.h rename to libunwind/include/libunwind-mips.h diff --git a/include/libunwind-ppc32.h b/libunwind/include/libunwind-ppc32.h similarity index 100% rename from include/libunwind-ppc32.h rename to libunwind/include/libunwind-ppc32.h diff --git a/include/libunwind-ppc64.h b/libunwind/include/libunwind-ppc64.h similarity index 100% rename from include/libunwind-ppc64.h rename to libunwind/include/libunwind-ppc64.h diff --git a/include/libunwind-ptrace.h b/libunwind/include/libunwind-ptrace.h similarity index 100% rename from include/libunwind-ptrace.h rename to libunwind/include/libunwind-ptrace.h diff --git a/include/libunwind-riscv.h b/libunwind/include/libunwind-riscv.h similarity index 100% rename from include/libunwind-riscv.h rename to libunwind/include/libunwind-riscv.h diff --git a/include/libunwind-s390x.h b/libunwind/include/libunwind-s390x.h similarity index 100% rename from include/libunwind-s390x.h rename to libunwind/include/libunwind-s390x.h diff --git a/include/libunwind-sh.h b/libunwind/include/libunwind-sh.h similarity index 100% rename from include/libunwind-sh.h rename to libunwind/include/libunwind-sh.h diff --git a/include/libunwind-tilegx.h b/libunwind/include/libunwind-tilegx.h similarity index 100% rename from include/libunwind-tilegx.h rename to libunwind/include/libunwind-tilegx.h diff --git a/include/libunwind-x86.h b/libunwind/include/libunwind-x86.h similarity index 98% rename from include/libunwind-x86.h rename to libunwind/include/libunwind-x86.h index d3b741d3..40fe0464 100644 --- a/include/libunwind-x86.h +++ b/libunwind/include/libunwind-x86.h @@ -34,10 +34,6 @@ extern "C" { #include #include -#ifndef UNW_EMPTY_STRUCT -# define UNW_EMPTY_STRUCT uint8_t unused; -#endif - #define UNW_TARGET x86 #define UNW_TARGET_X86 1 @@ -162,7 +158,6 @@ x86_regnum_t; typedef struct unw_tdep_save_loc { /* Additional target-dependent info on a save location. */ - UNW_EMPTY_STRUCT } unw_tdep_save_loc_t; @@ -174,7 +169,6 @@ typedef ucontext_t unw_tdep_context_t; typedef struct { /* no x86-specific auxiliary proc-info */ - UNW_EMPTY_STRUCT } unw_tdep_proc_info_t; diff --git a/include/libunwind-x86_64.h b/libunwind/include/libunwind-x86_64.h similarity index 100% rename from include/libunwind-x86_64.h rename to libunwind/include/libunwind-x86_64.h diff --git a/include/libunwind.h b/libunwind/include/libunwind.h old mode 100755 new mode 100644 similarity index 81% rename from include/libunwind.h rename to libunwind/include/libunwind.h index a20216c0..40f485dc --- a/include/libunwind.h +++ b/libunwind/include/libunwind.h @@ -17,8 +17,6 @@ # include "libunwind-ppc32.h" #elif defined __powerpc64__ # include "libunwind-ppc64.h" -#elif defined(__riscv) -# include "libunwind-riscv.h" #elif defined __sh__ # include "libunwind-sh.h" #elif defined __i386__ @@ -27,20 +25,16 @@ # include "libunwind-x86_64.h" #elif defined __tilegx__ # include "libunwind-tilegx.h" +#elif defined __s390x__ +# include "libunwind-s390x.h" +#elif defined __riscv || defined __riscv__ +# include "libunwind-riscv.h" #else # error "Unsupported arch" #endif #else /* UNW_REMOTE_ONLY */ -#if defined UNW_TARGET_ARM -# include "libunwind-arm.h" -#elif defined UNW_TARGET_ARM64 -# include "libunwind-aarch64.h" -#elif defined UNW_TARGET_RISCV -# include "libunwind-riscv.h" -#else # include "libunwind-x86_64.h" -#endif #endif /* UNW_REMOTE_ONLY */ diff --git a/include/libunwind.h.in b/libunwind/include/libunwind.h.in similarity index 100% rename from include/libunwind.h.in rename to libunwind/include/libunwind.h.in diff --git a/include/libunwind_i.h b/libunwind/include/libunwind_i.h similarity index 87% rename from include/libunwind_i.h rename to libunwind/include/libunwind_i.h index a684af97..97422679 100644 --- a/include/libunwind_i.h +++ b/libunwind/include/libunwind_i.h @@ -55,11 +55,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include -#include -#include -#ifdef PARSE_BUILD_ID -#include -#endif #if defined(HAVE_ELF_H) # include @@ -121,20 +116,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # endif #endif -#define UNW_TEMP_FAILURE_RETRY(exp) \ - ({ \ - long int _rc; \ - do { \ - _rc = (long int)(exp); \ - } while ((_rc == -1) && (errno == EINTR)); \ - _rc; \ - }) - static inline int byte_order_is_valid(int byte_order) { - return byte_order != UNW_BIG_ENDIAN - && byte_order != UNW_LITTLE_ENDIAN; + return byte_order == UNW_BIG_ENDIAN + || byte_order == UNW_LITTLE_ENDIAN; } static inline int @@ -144,7 +130,7 @@ byte_order_is_big_endian(int byte_order) } static inline int -target_is_big_endian(void) +target_is_big_endian() { return byte_order_is_big_endian(UNW_BYTE_ORDER); } @@ -184,7 +170,7 @@ target_is_big_endian(void) /* Type of a mask that can be used to inhibit preemption. At the userlevel, preemption is caused by signals and hence sigset_t is - appropriate. In contrast, the Linux kernel uses "unsigned long" + appropriate. In constrast, the Linux kernel uses "unsigned long" to hold the processor "flags" instead. */ typedef sigset_t intrmask_t; @@ -293,8 +279,7 @@ do { \ fprintf (stderr, /* format */ __VA_ARGS__) #else # define Debug(level, /* format */ ...) -# define Dprintf(/* format */ ...) \ - fprintf (stderr, /* format */ __VA_ARGS__) +# define Dprintf( /* format */ ...) #endif static ALWAYS_INLINE int @@ -310,13 +295,15 @@ extern unw_word_t _U_dyn_info_list_addr (void); /* This is needed/used by ELF targets only. */ +struct elf_image + { + void *image; /* pointer to mmap'd image */ + size_t size; /* (file-) size of the image */ + }; + struct elf_dyn_info { - /* Add For Cache MAP And ELF*/ - /* Removed: struct elf_image ei; */ - /* Add For Cache MAP And ELF */ - unw_word_t start_ip; - unw_word_t end_ip; + struct elf_image ei; unw_dyn_info_t di_cache; unw_dyn_info_t di_debug; /* additional table info for .debug_frame */ #if UNW_TARGET_IA64 @@ -326,36 +313,11 @@ struct elf_dyn_info unw_dyn_info_t di_arm; /* additional table info for .ARM.exidx */ #endif }; -#ifdef PARSE_BUILD_ID -struct build_id_note { - ElfW(Nhdr) nhdr; - char name[4]; - uint8_t build_id[0]; -}; -#endif -struct elf_image - { - void *image; /* pointer to mmap'd image */ - size_t size; /* (file-) size of the image */ - int has_dyn_info; - struct elf_dyn_info elf_dyn_info; - int load_bias; - int load_offset; - char* strtab; - size_t lib_name_offset; -#ifdef PARSE_BUILD_ID - struct build_id_note* build_id_note; -#endif - struct elf_image* mdi; - int has_try_load; - }; static inline void invalidate_edi (struct elf_dyn_info *edi) { - /* Add For Cache MAP And ELF*/ - /* Removed: if (edi->ei.image) */ - /* munmap (edi->ei.image, edi->ei.size); */ - /* Add For Cache MAP And ELF */ + if (edi->ei.image) + munmap (edi->ei.image, edi->ei.size); memset (edi, 0, sizeof (*edi)); edi->di_cache.format = -1; edi->di_debug.format = -1; @@ -364,15 +326,6 @@ static inline void invalidate_edi (struct elf_dyn_info *edi) #endif } -static inline unw_word_t clear_ptrauth(unw_word_t ip) -{ -#ifdef __aarch64__ - unw_word_t insn_mask = 0xFFFFFF8000000000; // mask all bits from [63:40]; - return ip & (~insn_mask); -#else - return ip; -#endif -} /* Provide a place holder for architecture to override for fast access to memory when known not to need to validate and know the access @@ -393,10 +346,6 @@ static inline unw_word_t clear_ptrauth(unw_word_t ip) #include "tdep/libunwind_i.h" -#ifndef TDEP_DWARF_SP -#define TDEP_DWARF_SP UNW_TDEP_SP -#endif - #ifndef tdep_get_func_addr # define tdep_get_func_addr(as,addr,v) (*(v) = addr, 0) #endif diff --git a/include/mempool.h b/libunwind/include/mempool.h similarity index 96% rename from include/mempool.h rename to libunwind/include/mempool.h index 60b91372..1f1c7700 100644 --- a/include/mempool.h +++ b/libunwind/include/mempool.h @@ -63,8 +63,8 @@ struct mempool pthread_mutex_t lock; size_t obj_size; /* object size (rounded up for alignment) */ size_t chunk_size; /* allocation granularity */ - size_t reserve; /* minimum (desired) size of the free-list */ - size_t num_free; /* number of objects on the free-list */ + unsigned int reserve; /* minimum (desired) size of the free-list */ + unsigned int num_free; /* number of objects on the free-list */ struct object { struct object *next; diff --git a/include/remote.h b/libunwind/include/remote.h similarity index 91% rename from include/remote.h rename to libunwind/include/remote.h index 07d58997..b3ac97f6 100644 --- a/include/remote.h +++ b/libunwind/include/remote.h @@ -5,8 +5,6 @@ assume that all addresses are naturally aligned (e.g., 32-bit quantity is stored at a 32-bit-aligned address. */ -#define WSIZE (sizeof (unw_word_t)) - #ifdef UNW_LOCAL_ONLY static inline int @@ -47,11 +45,13 @@ fetchw (unw_addr_space_t as, unw_accessors_t *a, #else /* !UNW_LOCAL_ONLY */ +#define WSIZE (sizeof (unw_word_t)) + static inline int fetch8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int8_t *valp, void *arg) { - unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; + unw_word_t val, aligned_addr = *addr & -WSIZE, off = *addr - aligned_addr; int ret; *addr += 1; @@ -71,7 +71,7 @@ static inline int fetch16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int16_t *valp, void *arg) { - unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; + unw_word_t val, aligned_addr = *addr & -WSIZE, off = *addr - aligned_addr; int ret; if ((off & 0x1) != 0) @@ -94,7 +94,7 @@ static inline int fetch32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int32_t *valp, void *arg) { - unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; + unw_word_t val, aligned_addr = *addr & -WSIZE, off = *addr - aligned_addr; int ret; if ((off & 0x3) != 0) diff --git a/libunwind/include/stamp-h1 b/libunwind/include/stamp-h1 new file mode 100644 index 00000000..b330768e --- /dev/null +++ b/libunwind/include/stamp-h1 @@ -0,0 +1 @@ +timestamp for include/config.h diff --git a/include/tdep-aarch64/dwarf-config.h b/libunwind/include/tdep-aarch64/dwarf-config.h similarity index 94% rename from include/tdep-aarch64/dwarf-config.h rename to libunwind/include/tdep-aarch64/dwarf-config.h index 59b24d6e..f65db17e 100644 --- a/include/tdep-aarch64/dwarf-config.h +++ b/libunwind/include/tdep-aarch64/dwarf-config.h @@ -31,12 +31,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ gcc/config/aarch64/aarch64.h:DWARF_FRAME_REGISTERS. */ #define DWARF_NUM_PRESERVED_REGS 97 -#define DWARF_UNW_AARCH64_V31 95 - /* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ #define dwarf_is_big_endian(addr_space) 0 -#define dwarf_to_unw_regnum(reg) (((reg) <= DWARF_UNW_AARCH64_V31) ? (reg) : 0) +#define dwarf_to_unw_regnum(reg) (((reg) <= UNW_AARCH64_V31) ? (reg) : 0) /* Convert a pointer to a dwarf_cursor structure to a pointer to unw_cursor_t. */ diff --git a/include/tdep-aarch64/jmpbuf.h b/libunwind/include/tdep-aarch64/jmpbuf.h similarity index 100% rename from include/tdep-aarch64/jmpbuf.h rename to libunwind/include/tdep-aarch64/jmpbuf.h diff --git a/include/tdep-aarch64/libunwind_i.h b/libunwind/include/tdep-aarch64/libunwind_i.h similarity index 89% rename from include/tdep-aarch64/libunwind_i.h rename to libunwind/include/tdep-aarch64/libunwind_i.h index f8a9cdf2..d96833a2 100644 --- a/include/tdep-aarch64/libunwind_i.h +++ b/libunwind/include/tdep-aarch64/libunwind_i.h @@ -35,9 +35,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf64.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -87,23 +84,8 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ - struct cursor *cursor; - int pid; }; -static inline struct cursor * -get_cursor_from_as(unw_addr_space_t as) -{ - if (as->cursor) { - return (struct cursor *)(as->cursor); - } - - return NULL; -} - struct cursor { struct dwarf_cursor dwarf; /* must be first */ @@ -146,20 +128,18 @@ dwarf_get_uc(const struct dwarf_cursor *cursor) static inline int dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) { - unw_fpreg_t *addr = (unw_fpreg_t *) (uintptr_t) DWARF_GET_LOC (loc); - if (!addr || maps_is_readable(c->as->map_list, (unw_word_t) (uintptr_t) addr)) + if (!DWARF_GET_LOC (loc)) return -1; - *val = *addr; + *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); return 0; } static inline int dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) { - unw_fpreg_t *addr = (unw_fpreg_t *) (uintptr_t) DWARF_GET_LOC (loc); - if (!addr || maps_is_writable(c->as->map_list, (unw_word_t) (uintptr_t) addr)) + if (!DWARF_GET_LOC (loc)) return -1; - *addr = val; + *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; return 0; } @@ -168,7 +148,8 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) { if (!DWARF_GET_LOC (loc)) return -1; - return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); + *val = *(unw_word_t *) DWARF_GET_LOC (loc); + return 0; } static inline int @@ -176,7 +157,8 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) { if (!DWARF_GET_LOC (loc)) return -1; - return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, 1, c->as_arg); + *(unw_word_t *) DWARF_GET_LOC (loc) = val; + return 0; } #else /* !UNW_LOCAL_ONLY */ @@ -248,7 +230,6 @@ dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) static inline int dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) { - int reg_num; if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; @@ -258,16 +239,9 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) happen? */ assert (!DWARF_IS_FP_LOC (loc)); - if (DWARF_IS_REG_LOC (loc)) { - reg_num = DWARF_GET_LOC (loc); - if (reg_num >= 0 && reg_num < c->reg_sz) { - *val = c->ctx[reg_num]; - return 1; - } else { - return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, - 0, c->as_arg); - } - } + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); else return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); @@ -343,10 +317,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-arm/dwarf-config.h b/libunwind/include/tdep-arm/dwarf-config.h similarity index 100% rename from include/tdep-arm/dwarf-config.h rename to libunwind/include/tdep-arm/dwarf-config.h diff --git a/include/tdep-arm/ex_tables.h b/libunwind/include/tdep-arm/ex_tables.h similarity index 100% rename from include/tdep-arm/ex_tables.h rename to libunwind/include/tdep-arm/ex_tables.h diff --git a/include/tdep-arm/jmpbuf.h b/libunwind/include/tdep-arm/jmpbuf.h similarity index 100% rename from include/tdep-arm/jmpbuf.h rename to libunwind/include/tdep-arm/jmpbuf.h diff --git a/include/tdep-arm/libunwind_i.h b/libunwind/include/tdep-arm/libunwind_i.h similarity index 87% rename from include/tdep-arm/libunwind_i.h rename to libunwind/include/tdep-arm/libunwind_i.h index 9faac25d..88ebfb06 100644 --- a/include/tdep-arm/libunwind_i.h +++ b/libunwind/include/tdep-arm/libunwind_i.h @@ -33,9 +33,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf32.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" #include "ex_tables.h" @@ -73,23 +70,8 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ - struct cursor *cursor; - int pid; }; -static inline struct cursor * -get_cursor_from_as(unw_addr_space_t as) -{ - if (as->cursor) { - return (struct cursor *)(as->cursor); - } - - return NULL; -} - struct cursor { struct dwarf_cursor dwarf; /* must be first */ @@ -129,20 +111,18 @@ struct cursor static inline int dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) { - unw_fpreg_t *addr = (unw_fpreg_t *) (uintptr_t) DWARF_GET_LOC (loc); - if (!addr || maps_is_readable(c->as->map_list, (unw_word_t) (uintptr_t) addr)) + if (!DWARF_GET_LOC (loc)) return -1; - *val = *addr; + *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); return 0; } static inline int dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) { - unw_fpreg_t *addr = (unw_fpreg_t *) (uintptr_t) DWARF_GET_LOC (loc); - if (!addr || maps_is_writable(c->as->map_list, (unw_word_t) (uintptr_t) addr)) + if (!DWARF_GET_LOC (loc)) return -1; - *addr = val; + *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; return 0; } @@ -151,7 +131,8 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) { if (!DWARF_GET_LOC (loc)) return -1; - return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); + *val = *(unw_word_t *) DWARF_GET_LOC (loc); + return 0; } static inline int @@ -159,7 +140,8 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) { if (!DWARF_GET_LOC (loc)) return -1; - return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, 1, c->as_arg); + *(unw_word_t *) DWARF_GET_LOC (loc) = val; + return 0; } #else /* !UNW_LOCAL_ONLY */ @@ -231,7 +213,6 @@ dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) static inline int dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) { - int reg_num; if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; @@ -241,16 +222,9 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) happen? */ assert (!DWARF_IS_FP_LOC (loc)); - if (DWARF_IS_REG_LOC (loc)) { - reg_num = DWARF_GET_LOC (loc); - if (reg_num >= 0 && reg_num < c->reg_sz) { - *val = c->ctx[reg_num]; - return 1; - } else { - return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, - 0, c->as_arg); - } - } + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); else return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); @@ -280,10 +254,8 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) #define tdep_getcontext_trace unw_getcontext #define tdep_init_done UNW_OBJ(init_done) -#define tdep_init_mem_validate UNW_OBJ(init_mem_validate) #define tdep_init UNW_OBJ(init) #define arm_find_proc_info UNW_OBJ(find_proc_info) -#define arm_find_proc_info2 UNW_OBJ(find_proc_info2) #define arm_put_unwind_info UNW_OBJ(put_unwind_info) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ @@ -322,23 +294,18 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) extern atomic_bool tdep_init_done; extern void tdep_init (void); -extern void tdep_init_mem_validate (void); extern int arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, int need_unwind_info, void *arg); -extern int arm_find_proc_info2 (unw_addr_space_t as, unw_word_t ip, - unw_proc_info_t *pi, int need_unwind_info, - void *arg, int methods); extern void arm_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg); extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-hppa/dwarf-config.h b/libunwind/include/tdep-hppa/dwarf-config.h similarity index 100% rename from include/tdep-hppa/dwarf-config.h rename to libunwind/include/tdep-hppa/dwarf-config.h diff --git a/include/tdep-hppa/jmpbuf.h b/libunwind/include/tdep-hppa/jmpbuf.h similarity index 100% rename from include/tdep-hppa/jmpbuf.h rename to libunwind/include/tdep-hppa/jmpbuf.h diff --git a/include/tdep-hppa/libunwind_i.h b/libunwind/include/tdep-hppa/libunwind_i.h similarity index 96% rename from include/tdep-hppa/libunwind_i.h rename to libunwind/include/tdep-hppa/libunwind_i.h index c0db9d17..fd5910d0 100644 --- a/include/tdep-hppa/libunwind_i.h +++ b/libunwind/include/tdep-hppa/libunwind_i.h @@ -34,9 +34,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf32.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -55,9 +52,6 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ }; struct cursor @@ -270,10 +264,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-ia64/jmpbuf.h b/libunwind/include/tdep-ia64/jmpbuf.h similarity index 100% rename from include/tdep-ia64/jmpbuf.h rename to libunwind/include/tdep-ia64/jmpbuf.h diff --git a/include/tdep-ia64/libunwind_i.h b/libunwind/include/tdep-ia64/libunwind_i.h similarity index 96% rename from include/tdep-ia64/libunwind_i.h rename to libunwind/include/tdep-ia64/libunwind_i.h index 4784a8aa..8cb8fea2 100644 --- a/include/tdep-ia64/libunwind_i.h +++ b/libunwind/include/tdep-ia64/libunwind_i.h @@ -30,9 +30,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ to be shared with target-independent code. */ #include "elf64.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include @@ -109,10 +106,6 @@ struct unw_addr_space #endif struct ia64_script_cache global_cache; - - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ }; /* Note: The ABI numbers in the ABI-markers (.unwabi directive) are @@ -265,10 +258,9 @@ extern void tdep_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, unw_regnum_t regnum, uint8_t *nat_bitnr); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-ia64/rse.h b/libunwind/include/tdep-ia64/rse.h similarity index 100% rename from include/tdep-ia64/rse.h rename to libunwind/include/tdep-ia64/rse.h diff --git a/include/tdep-ia64/script.h b/libunwind/include/tdep-ia64/script.h similarity index 100% rename from include/tdep-ia64/script.h rename to libunwind/include/tdep-ia64/script.h diff --git a/include/tdep-mips/dwarf-config.h b/libunwind/include/tdep-mips/dwarf-config.h similarity index 100% rename from include/tdep-mips/dwarf-config.h rename to libunwind/include/tdep-mips/dwarf-config.h diff --git a/include/tdep-mips/jmpbuf.h b/libunwind/include/tdep-mips/jmpbuf.h similarity index 100% rename from include/tdep-mips/jmpbuf.h rename to libunwind/include/tdep-mips/jmpbuf.h diff --git a/include/tdep-mips/libunwind_i.h b/libunwind/include/tdep-mips/libunwind_i.h similarity index 92% rename from include/tdep-mips/libunwind_i.h rename to libunwind/include/tdep-mips/libunwind_i.h index b1132910..343a1951 100644 --- a/include/tdep-mips/libunwind_i.h +++ b/libunwind/include/tdep-mips/libunwind_i.h @@ -37,9 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #else # include "elf32.h" #endif -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -63,9 +60,6 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ }; #define tdep_big_endian(as) ((as)->big_endian) @@ -101,20 +95,18 @@ typedef long mips_reg_t; static inline int dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) { - unw_fpreg_t *addr = (unw_fpreg_t *) (uintptr_t) DWARF_GET_LOC (loc); - if (!addr || maps_is_readable(c->as->map_list, (unw_word_t) (uintptr_t) addr)) + if (!DWARF_GET_LOC (loc)) return -1; - *val = *addr; + *val = *(unw_fpreg_t *) (intptr_t) DWARF_GET_LOC (loc); return 0; } static inline int dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) { - unw_fpreg_t *addr = (unw_fpreg_t *) (uintptr_t) DWARF_GET_LOC (loc); - if (!addr || maps_is_writable(c->as->map_list, (unw_word_t) (uintptr_t) addr)) + if (!DWARF_GET_LOC (loc)) return -1; - *addr = val; + *(unw_fpreg_t *) (intptr_t) DWARF_GET_LOC (loc) = val; return 0; } @@ -123,7 +115,8 @@ dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) { if (!DWARF_GET_LOC (loc)) return -1; - return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); + *val = *(mips_reg_t *) (intptr_t) DWARF_GET_LOC (loc); + return 0; } static inline int @@ -131,7 +124,8 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) { if (!DWARF_GET_LOC (loc)) return -1; - return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, 1, c->as_arg); + *(mips_reg_t *) (intptr_t) DWARF_GET_LOC (loc) = val; + return 0; } #else /* !UNW_LOCAL_ONLY */ @@ -330,10 +324,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-ppc32/dwarf-config.h b/libunwind/include/tdep-ppc32/dwarf-config.h similarity index 100% rename from include/tdep-ppc32/dwarf-config.h rename to libunwind/include/tdep-ppc32/dwarf-config.h diff --git a/include/tdep-ppc32/jmpbuf.h b/libunwind/include/tdep-ppc32/jmpbuf.h similarity index 100% rename from include/tdep-ppc32/jmpbuf.h rename to libunwind/include/tdep-ppc32/jmpbuf.h diff --git a/include/tdep-ppc32/libunwind_i.h b/libunwind/include/tdep-ppc32/libunwind_i.h similarity index 97% rename from include/tdep-ppc32/libunwind_i.h rename to libunwind/include/tdep-ppc32/libunwind_i.h index a4c7de66..b9100e6a 100644 --- a/include/tdep-ppc32/libunwind_i.h +++ b/libunwind/include/tdep-ppc32/libunwind_i.h @@ -40,9 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf32.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -62,9 +59,6 @@ struct unw_addr_space struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; int validate; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ }; struct cursor @@ -303,10 +297,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t * pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t * uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t * valp, int write); diff --git a/include/tdep-ppc64/dwarf-config.h b/libunwind/include/tdep-ppc64/dwarf-config.h similarity index 100% rename from include/tdep-ppc64/dwarf-config.h rename to libunwind/include/tdep-ppc64/dwarf-config.h diff --git a/include/tdep-ppc64/jmpbuf.h b/libunwind/include/tdep-ppc64/jmpbuf.h similarity index 100% rename from include/tdep-ppc64/jmpbuf.h rename to libunwind/include/tdep-ppc64/jmpbuf.h diff --git a/include/tdep-ppc64/libunwind_i.h b/libunwind/include/tdep-ppc64/libunwind_i.h similarity index 97% rename from include/tdep-ppc64/libunwind_i.h rename to libunwind/include/tdep-ppc64/libunwind_i.h index e3030abf..48227c76 100644 --- a/include/tdep-ppc64/libunwind_i.h +++ b/libunwind/include/tdep-ppc64/libunwind_i.h @@ -40,9 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf64.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -64,9 +61,6 @@ struct unw_addr_space struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; int validate; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ }; struct cursor @@ -358,10 +352,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t * pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t * uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t * valp, int write); diff --git a/include/tdep-riscv/dwarf-config.h b/libunwind/include/tdep-riscv/dwarf-config.h similarity index 100% rename from include/tdep-riscv/dwarf-config.h rename to libunwind/include/tdep-riscv/dwarf-config.h diff --git a/include/tdep-riscv/jmpbuf.h b/libunwind/include/tdep-riscv/jmpbuf.h similarity index 100% rename from include/tdep-riscv/jmpbuf.h rename to libunwind/include/tdep-riscv/jmpbuf.h diff --git a/include/tdep-riscv/libunwind_i.h b/libunwind/include/tdep-riscv/libunwind_i.h similarity index 95% rename from include/tdep-riscv/libunwind_i.h rename to libunwind/include/tdep-riscv/libunwind_i.h index f7f7d931..4404a475 100644 --- a/include/tdep-riscv/libunwind_i.h +++ b/libunwind/include/tdep-riscv/libunwind_i.h @@ -44,8 +44,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # error "Unsupported address size" #endif -/* Add For Cache MAP And ELF */ -#include "map_info.h" #include "mempool.h" #include "dwarf.h" @@ -68,24 +66,10 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - struct cursor *cursor; - int pid; }; #define tdep_big_endian(as) ((as)->big_endian) -static inline struct cursor * -get_cursor_from_as(unw_addr_space_t as) -{ - if (as->cursor) { - return (struct cursor *)(as->cursor); - } - - return NULL; -} - struct cursor { struct dwarf_cursor dwarf; /* must be first */ @@ -177,6 +161,7 @@ dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) { char *valp = (char *) &val; unw_word_t addr; + int ret; if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; @@ -200,6 +185,7 @@ dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) { char *valp = (char *) &val; unw_word_t addr; + int ret; if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; @@ -305,10 +291,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); - +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-s390x/dwarf-config.h b/libunwind/include/tdep-s390x/dwarf-config.h similarity index 100% rename from include/tdep-s390x/dwarf-config.h rename to libunwind/include/tdep-s390x/dwarf-config.h diff --git a/include/tdep-s390x/jmpbuf.h b/libunwind/include/tdep-s390x/jmpbuf.h similarity index 100% rename from include/tdep-s390x/jmpbuf.h rename to libunwind/include/tdep-s390x/jmpbuf.h diff --git a/include/tdep-s390x/libunwind_i.h b/libunwind/include/tdep-s390x/libunwind_i.h similarity index 100% rename from include/tdep-s390x/libunwind_i.h rename to libunwind/include/tdep-s390x/libunwind_i.h diff --git a/include/tdep-sh/dwarf-config.h b/libunwind/include/tdep-sh/dwarf-config.h similarity index 100% rename from include/tdep-sh/dwarf-config.h rename to libunwind/include/tdep-sh/dwarf-config.h diff --git a/include/tdep-sh/jmpbuf.h b/libunwind/include/tdep-sh/jmpbuf.h similarity index 100% rename from include/tdep-sh/jmpbuf.h rename to libunwind/include/tdep-sh/jmpbuf.h diff --git a/include/tdep-sh/libunwind_i.h b/libunwind/include/tdep-sh/libunwind_i.h similarity index 96% rename from include/tdep-sh/libunwind_i.h rename to libunwind/include/tdep-sh/libunwind_i.h index 994cb52f..7b4fe002 100644 --- a/include/tdep-sh/libunwind_i.h +++ b/libunwind/include/tdep-sh/libunwind_i.h @@ -34,9 +34,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf32.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -56,9 +53,6 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ }; struct cursor @@ -271,10 +265,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-tilegx/dwarf-config.h b/libunwind/include/tdep-tilegx/dwarf-config.h similarity index 100% rename from include/tdep-tilegx/dwarf-config.h rename to libunwind/include/tdep-tilegx/dwarf-config.h diff --git a/include/tdep-tilegx/jmpbuf.h b/libunwind/include/tdep-tilegx/jmpbuf.h similarity index 100% rename from include/tdep-tilegx/jmpbuf.h rename to libunwind/include/tdep-tilegx/jmpbuf.h diff --git a/include/tdep-tilegx/libunwind_i.h b/libunwind/include/tdep-tilegx/libunwind_i.h similarity index 100% rename from include/tdep-tilegx/libunwind_i.h rename to libunwind/include/tdep-tilegx/libunwind_i.h diff --git a/include/tdep-x86/dwarf-config.h b/libunwind/include/tdep-x86/dwarf-config.h similarity index 100% rename from include/tdep-x86/dwarf-config.h rename to libunwind/include/tdep-x86/dwarf-config.h diff --git a/include/tdep-x86/jmpbuf.h b/libunwind/include/tdep-x86/jmpbuf.h similarity index 100% rename from include/tdep-x86/jmpbuf.h rename to libunwind/include/tdep-x86/jmpbuf.h diff --git a/include/tdep-x86/libunwind_i.h b/libunwind/include/tdep-x86/libunwind_i.h similarity index 94% rename from include/tdep-x86/libunwind_i.h rename to libunwind/include/tdep-x86/libunwind_i.h index 603100ac..d4c5ccdb 100644 --- a/include/tdep-x86/libunwind_i.h +++ b/libunwind/include/tdep-x86/libunwind_i.h @@ -34,9 +34,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf32.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -55,25 +52,8 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ -#if defined(__linux__) - struct map_info *map_list; -#endif - /* Add For Cache MAP And ELF */ - unw_cursor_t *cursor; - int pid; }; -static inline struct cursor * -get_cursor_from_as(unw_addr_space_t as) -{ - if (as->cursor) { - return (struct cursor *)(as->cursor); - } - - return NULL; -} - struct cursor { struct dwarf_cursor dwarf; /* must be first */ @@ -298,10 +278,9 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); diff --git a/include/tdep-x86_64/dwarf-config.h b/libunwind/include/tdep-x86_64/dwarf-config.h similarity index 100% rename from include/tdep-x86_64/dwarf-config.h rename to libunwind/include/tdep-x86_64/dwarf-config.h diff --git a/include/tdep-x86_64/jmpbuf.h b/libunwind/include/tdep-x86_64/jmpbuf.h similarity index 100% rename from include/tdep-x86_64/jmpbuf.h rename to libunwind/include/tdep-x86_64/jmpbuf.h diff --git a/include/tdep-x86_64/libunwind_i.h b/libunwind/include/tdep-x86_64/libunwind_i.h similarity index 91% rename from include/tdep-x86_64/libunwind_i.h rename to libunwind/include/tdep-x86_64/libunwind_i.h index 1d7091fe..ff0436a0 100644 --- a/include/tdep-x86_64/libunwind_i.h +++ b/libunwind/include/tdep-x86_64/libunwind_i.h @@ -37,9 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "elf64.h" -/* Add For Cache MAP And ELF */ -#include "map_info.h" -/* Add For Cache MAP And ELF */ #include "mempool.h" #include "dwarf.h" @@ -74,23 +71,8 @@ struct unw_addr_space unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ struct dwarf_rs_cache global_cache; struct unw_debug_frame_list *debug_frames; - /* Add For Cache MAP And ELF */ - struct map_info *map_list; - /* Add For Cache MAP And ELF */ - unw_cursor_t *cursor; - int pid; }; -static inline struct cursor * -get_cursor_from_as(unw_addr_space_t as) -{ - if (as->cursor) { - return (struct cursor *)(as->cursor); - } - - return NULL; -} - struct cursor { struct dwarf_cursor dwarf; /* must be first */ @@ -210,21 +192,12 @@ dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) static inline int dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) { - - int reg_num; if (DWARF_IS_NULL_LOC (loc)) return -UNW_EBADREG; - if (DWARF_IS_REG_LOC (loc)) { - reg_num = DWARF_GET_LOC (loc); - if (reg_num >= 0 && reg_num < c->reg_sz) { - *val = c->ctx[reg_num]; - return 1; - } else { - return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, - 0, c->as_arg); - } - } + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); if (DWARF_IS_MEM_LOC (loc)) return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, 0, c->as_arg); @@ -261,7 +234,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) #define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path) #define tdep_access_reg UNW_OBJ(access_reg) #define tdep_access_fpreg UNW_OBJ(access_fpreg) -#if __linux__ || defined(UNW_TARGET_X86_64_LINUX) +#if __linux__ # define tdep_fetch_frame UNW_OBJ(fetch_frame) # define tdep_cache_frame UNW_OBJ(cache_frame) # define tdep_reuse_frame UNW_OBJ(reuse_frame) @@ -301,16 +274,15 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *x86_64_r_uc_addr (ucontext_t *uc, int reg); -/* Add For Cache MAP And ELF */ -extern struct map_info *tdep_get_elf_image (unw_addr_space_t as, pid_t pid, - unw_word_t ip); -/* Add For Cache MAP And ELF */ +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); extern void tdep_get_exe_image_path (char *path); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, int write); -#if __linux__ || defined(UNW_TARGET_X86_64_LINUX) +#if __linux__ extern void tdep_fetch_frame (struct dwarf_cursor *c, unw_word_t ip, int need_unwind_info); extern int tdep_cache_frame (struct dwarf_cursor *c); diff --git a/include/tdep/dwarf-config.h b/libunwind/include/tdep/dwarf-config.h similarity index 100% rename from include/tdep/dwarf-config.h rename to libunwind/include/tdep/dwarf-config.h diff --git a/include/tdep/jmpbuf.h b/libunwind/include/tdep/jmpbuf.h similarity index 100% rename from include/tdep/jmpbuf.h rename to libunwind/include/tdep/jmpbuf.h diff --git a/include/tdep/libunwind_i.h b/libunwind/include/tdep/libunwind_i.h old mode 100755 new mode 100644 similarity index 81% rename from include/tdep/libunwind_i.h rename to libunwind/include/tdep/libunwind_i.h index e655da40..efd4f875 --- a/include/tdep/libunwind_i.h +++ b/libunwind/include/tdep/libunwind_i.h @@ -25,7 +25,9 @@ # include "tdep-x86_64/libunwind_i.h" #elif defined __tilegx__ # include "tdep-tilegx/libunwind_i.h" -#elif defined(__riscv) +#elif defined __s390x__ +# include "tdep-s390x/libunwind_i.h" +#elif defined __riscv || defined __riscv__ # include "tdep-riscv/libunwind_i.h" #else # error "Unsupported arch" @@ -33,13 +35,7 @@ #else /* UNW_REMOTE_ONLY */ -#if defined UNW_TARGET_ARM -# include "tdep-arm/libunwind_i.h" -#elif defined UNW_TARGET_ARM64 -# include "tdep-aarch64/libunwind_i.h" -#elif defined UNW_TARGET_RISCV -# include "tdep-riscv/libunwind_i.h" -#else + # include "tdep-x86_64/libunwind_i.h" -#endif + #endif /* UNW_REMOTE_ONLY */ diff --git a/include/tdep/libunwind_i.h.in b/libunwind/include/tdep/libunwind_i.h.in similarity index 100% rename from include/tdep/libunwind_i.h.in rename to libunwind/include/tdep/libunwind_i.h.in diff --git a/include/unwind.h b/libunwind/include/unwind.h similarity index 100% rename from include/unwind.h rename to libunwind/include/unwind.h diff --git a/src/Makefile.am b/libunwind/src/Makefile.am similarity index 99% rename from src/Makefile.am rename to libunwind/src/Makefile.am index df10ed1f..2b5b0295 100644 --- a/src/Makefile.am +++ b/libunwind/src/Makefile.am @@ -340,7 +340,7 @@ libunwind_tilegx_la_SOURCES_tilegx = $(libunwind_la_SOURCES_tilegx_common) \ tilegx/Gis_signal_frame.c tilegx/Gregs.c tilegx/Gresume.c tilegx/Gstep.c # The list of files that go info libunwind and libunwind-riscv: -noinst_HEADERS += riscv/init.h riscv/offsets.h riscv/unwind_i.h +noinst_HEADERS += riscv/init.h riscv/offsets.h riscv/unwind_i.h riscv/asm.h libunwind_la_SOURCES_riscv_common = $(libunwind_la_SOURCES_common) \ riscv/is_fpreg.c riscv/regname.c diff --git a/src/aarch64/Gapply_reg_state.c b/libunwind/src/aarch64/Gapply_reg_state.c similarity index 100% rename from src/aarch64/Gapply_reg_state.c rename to libunwind/src/aarch64/Gapply_reg_state.c diff --git a/src/aarch64/Gcreate_addr_space.c b/libunwind/src/aarch64/Gcreate_addr_space.c similarity index 98% rename from src/aarch64/Gcreate_addr_space.c rename to libunwind/src/aarch64/Gcreate_addr_space.c index a708c210..ac2b85e2 100644 --- a/src/aarch64/Gcreate_addr_space.c +++ b/libunwind/src/aarch64/Gcreate_addr_space.c @@ -47,8 +47,7 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order) memset (as, 0, sizeof (*as)); as->acc = *a; - as->cursor = NULL; - as->pid = -1; + /* Default to little-endian for AArch64. */ if (byte_order == 0 || byte_order == UNW_LITTLE_ENDIAN) as->big_endian = 0; diff --git a/src/aarch64/Gget_proc_info.c b/libunwind/src/aarch64/Gget_proc_info.c similarity index 100% rename from src/aarch64/Gget_proc_info.c rename to libunwind/src/aarch64/Gget_proc_info.c diff --git a/src/aarch64/Gget_save_loc.c b/libunwind/src/aarch64/Gget_save_loc.c similarity index 100% rename from src/aarch64/Gget_save_loc.c rename to libunwind/src/aarch64/Gget_save_loc.c diff --git a/src/aarch64/Gglobal.c b/libunwind/src/aarch64/Gglobal.c similarity index 100% rename from src/aarch64/Gglobal.c rename to libunwind/src/aarch64/Gglobal.c index 23bececa..2987f2af 100644 --- a/src/aarch64/Gglobal.c +++ b/libunwind/src/aarch64/Gglobal.c @@ -47,9 +47,9 @@ tdep_init (void) dwarf_init (); -#ifndef UNW_REMOTE_ONLY tdep_init_mem_validate (); +#ifndef UNW_REMOTE_ONLY aarch64_local_addr_space_init (); #endif atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ diff --git a/src/aarch64/Ginit.c b/libunwind/src/aarch64/Ginit.c similarity index 86% rename from src/aarch64/Ginit.c rename to libunwind/src/aarch64/Ginit.c index c586b0fe..2b08feb3 100644 --- a/src/aarch64/Ginit.c +++ b/libunwind/src/aarch64/Ginit.c @@ -28,7 +28,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include -#include #include #include "unwind_i.h" @@ -40,23 +39,15 @@ unw_addr_space_t unw_local_addr_space; #else /* !UNW_REMOTE_ONLY */ -#ifndef NO_RESERVE_CACHE static struct unw_addr_space local_addr_space; unw_addr_space_t unw_local_addr_space = &local_addr_space; -#else -unw_addr_space_t unw_local_addr_space; -#endif static inline void * uc_addr (unw_tdep_context_t *uc, int reg) { - if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_X30) + if (reg >= UNW_AARCH64_X0 && reg < UNW_AARCH64_V0) return &uc->uc_mcontext.regs[reg]; - else if (reg == UNW_AARCH64_SP) - return &uc->uc_mcontext.sp; - else if (reg == UNW_AARCH64_PC) - return &uc->uc_mcontext.pc; else if (reg >= UNW_AARCH64_V0 && reg <= UNW_AARCH64_V31) return &GET_FPCTX(uc)->vregs[reg - UNW_AARCH64_V0]; else @@ -140,11 +131,6 @@ open_pipe (void) ALWAYS_INLINE static int -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -__attribute__((no_sanitize("address"))) -#endif -#endif write_validate (void *addr) { int ret = -1; @@ -153,7 +139,7 @@ write_validate (void *addr) do { char buf; - bytes = syscall(SYS_read, mem_validate_pipe[0], &buf, 1); + bytes = read (mem_validate_pipe[0], &buf, 1); } while ( errno == EINTR ); @@ -166,7 +152,7 @@ write_validate (void *addr) do { - ret = syscall(SYS_write, mem_validate_pipe[1], addr, 1); + ret = write (mem_validate_pipe[1], addr, 1); } while ( errno == EINTR ); @@ -176,6 +162,11 @@ write_validate (void *addr) static int (*mem_validate_func) (void *addr, size_t len); static int msync_validate (void *addr, size_t len) { + if (msync (addr, len, MS_ASYNC) != 0) + { + return -1; + } + return write_validate (addr); } @@ -326,11 +317,6 @@ validate_mem (unw_word_t addr) } static int -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -__attribute__((no_sanitize("address"))) -#endif -#endif access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, void *arg) { @@ -343,7 +329,8 @@ access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, { /* validate address */ const struct cursor *c = (const struct cursor *)arg; - if (unlikely (validate_mem (addr))) { + if (likely (c != NULL) && unlikely (c->validate) + && unlikely (validate_mem (addr))) { Debug (16, "mem[%016lx] -> invalid\n", addr); return -1; } @@ -424,15 +411,9 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); } -static unw_word_t empty_ptrauth_mask(unw_addr_space_t addr_space_unused, void *as_arg_unused) -{ - return 0; -} - HIDDEN void aarch64_local_addr_space_init (void) { -#ifndef NO_RESERVE_CACHE memset (&local_addr_space, 0, sizeof (local_addr_space)); local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; local_addr_space.acc.find_proc_info = dwarf_find_proc_info; @@ -443,28 +424,8 @@ aarch64_local_addr_space_init (void) local_addr_space.acc.access_fpreg = access_fpreg; local_addr_space.acc.resume = aarch64_local_resume; local_addr_space.acc.get_proc_name = get_static_proc_name; - local_addr_space.acc.ptrauth_insn_mask = empty_ptrauth_mask; local_addr_space.big_endian = target_is_big_endian(); unw_flush_cache (&local_addr_space, 0, 0); -#endif -} - -HIDDEN void -init_local_addr_space (unw_addr_space_t as) -{ - memset (as, 0, sizeof (struct unw_addr_space)); - as->caching_policy = UNW_CACHE_NONE; - as->acc.find_proc_info = dwarf_find_proc_info; - as->acc.put_unwind_info = put_unwind_info; - as->acc.get_dyn_info_list_addr = get_dyn_info_list_addr; - as->acc.access_mem = access_mem; - as->acc.access_reg = access_reg; - as->acc.access_fpreg = access_fpreg; - as->acc.resume = aarch64_local_resume; - as->acc.get_proc_name = get_static_proc_name; - as->acc.ptrauth_insn_mask = empty_ptrauth_mask; - as->big_endian = target_is_big_endian(); - unw_flush_cache (as, 0, 0); } #endif /* !UNW_REMOTE_ONLY */ diff --git a/src/aarch64/Ginit_local.c b/libunwind/src/aarch64/Ginit_local.c similarity index 78% rename from src/aarch64/Ginit_local.c rename to libunwind/src/aarch64/Ginit_local.c index 7b816169..4a055fb0 100644 --- a/src/aarch64/Ginit_local.c +++ b/libunwind/src/aarch64/Ginit_local.c @@ -48,37 +48,12 @@ unw_init_local_common (unw_cursor_t *cursor, unw_context_t *uc, unsigned use_pre c->dwarf.as = unw_local_addr_space; c->dwarf.as_arg = c; - c->dwarf.as->pid = -1; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; c->uc = uc; - c->validate = 1; + c->validate = 0; return common_init (c, use_prev_instr); } -int -unw_init_local_with_as(unw_addr_space_t as, unw_cursor_t *cursor, unw_context_t *uc) -{ - struct cursor *c = (struct cursor *) cursor; - if (!atomic_load(&tdep_init_done)) - tdep_init (); - -#ifdef NO_RESERVE_CACHE - unw_local_addr_space = as; -#endif - c->dwarf.as = as; - c->dwarf.as_arg = c; - c->dwarf.as->pid = -1; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; - c->uc = uc; - c->validate = 1; - return common_init (c, 1); -} - int unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) { diff --git a/src/aarch64/Ginit_remote.c b/libunwind/src/aarch64/Ginit_remote.c similarity index 95% rename from src/aarch64/Ginit_remote.c rename to libunwind/src/aarch64/Ginit_remote.c index 0792b996..e300173c 100644 --- a/src/aarch64/Ginit_remote.c +++ b/libunwind/src/aarch64/Ginit_remote.c @@ -49,9 +49,6 @@ unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) c->dwarf.as_arg = as_arg; c->uc = 0; } - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; return common_init (c, 0); #endif /* !UNW_LOCAL_ONLY */ } diff --git a/src/aarch64/Gis_signal_frame.c b/libunwind/src/aarch64/Gis_signal_frame.c similarity index 100% rename from src/aarch64/Gis_signal_frame.c rename to libunwind/src/aarch64/Gis_signal_frame.c diff --git a/src/aarch64/Greg_states_iterate.c b/libunwind/src/aarch64/Greg_states_iterate.c similarity index 100% rename from src/aarch64/Greg_states_iterate.c rename to libunwind/src/aarch64/Greg_states_iterate.c diff --git a/src/aarch64/Gregs.c b/libunwind/src/aarch64/Gregs.c similarity index 96% rename from src/aarch64/Gregs.c rename to libunwind/src/aarch64/Gregs.c index 5ae47254..a8843734 100644 --- a/src/aarch64/Gregs.c +++ b/libunwind/src/aarch64/Gregs.c @@ -88,9 +88,6 @@ tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, case UNW_AARCH64_PSTATE: loc = c->dwarf.loc[reg]; break; - case UNW_AARCH64_RA_SIGN_STATE: - Debug (1, "Reading from ra sign state not supported: %u\n", reg); - return -UNW_EBADREG; case UNW_AARCH64_SP: if (write) diff --git a/src/aarch64/Gresume.c b/libunwind/src/aarch64/Gresume.c similarity index 100% rename from src/aarch64/Gresume.c rename to libunwind/src/aarch64/Gresume.c diff --git a/src/aarch64/Gstash_frame.c b/libunwind/src/aarch64/Gstash_frame.c similarity index 100% rename from src/aarch64/Gstash_frame.c rename to libunwind/src/aarch64/Gstash_frame.c diff --git a/src/aarch64/Gstep.c b/libunwind/src/aarch64/Gstep.c similarity index 73% rename from src/aarch64/Gstep.c rename to libunwind/src/aarch64/Gstep.c index 7b7acdf7..a858268d 100644 --- a/src/aarch64/Gstep.c +++ b/libunwind/src/aarch64/Gstep.c @@ -26,7 +26,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "offsets.h" -#include "os-ohos.h" + /* Recognise PLT entries such as: 40ddf0: b0000570 adrp x16, 4ba000 <_GLOBAL_OFFSET_TABLE_+0x2a8> 40ddf4: f9433611 ldr x17, [x16,#1640] @@ -55,7 +55,7 @@ static int aarch64_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; - int i, ret; + int ret; unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); @@ -82,9 +82,6 @@ aarch64_handle_signal_frame (unw_cursor_t *cursor) c->frame_info.frame_type = UNW_AARCH64_FRAME_SIGRETURN; c->frame_info.cfa_reg_offset = sc_addr - sp_addr; - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - /* Update the dwarf cursor. Set the location of the registers to the corresponding addresses of the uc_mcontext / sigcontext structure contents. */ @@ -126,7 +123,6 @@ aarch64_handle_signal_frame (unw_cursor_t *cursor) /* Set SP/CFA and PC/IP. */ dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa); dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); - dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X29], &c->dwarf.fp); c->dwarf.pi_valid = 0; c->dwarf.use_prev_instr = 0; @@ -134,27 +130,6 @@ aarch64_handle_signal_frame (unw_cursor_t *cursor) return 1; } -static int -step_by_frame_pointer (struct cursor *c) -{ - dwarf_loc_t ip_loc, fp_loc; - unw_word_t frame; - if (dwarf_get(&c->dwarf, c->dwarf.loc[UNW_AARCH64_X29], &frame) < 0) { - return 0; - } - - ip_loc = DWARF_LOC(frame + 8, 0); - fp_loc = DWARF_LOC(frame, 0); - if (dwarf_get(&c->dwarf, ip_loc, &c->dwarf.ip) < 0) - { - return 0; - } - c->dwarf.ip = clear_ptrauth(c->dwarf.ip); - c->dwarf.loc[UNW_AARCH64_PC] = ip_loc; - c->dwarf.loc[UNW_AARCH64_X29] = fp_loc; - return (c->dwarf.ip == 0) ? 0 : 1; -} - int unw_step (unw_cursor_t *cursor) { @@ -171,83 +146,70 @@ unw_step (unw_cursor_t *cursor) /* Check if this is a signal frame. */ ret = unw_is_signal_frame (cursor); if (ret > 0) - { - ret = aarch64_handle_signal_frame (cursor); - } - - /* Restore default memory validation state */ - c->validate = validate; - - ret = dwarf_step (&c->dwarf); -#ifdef HAS_ARK_FRAME - if (ret < 0 && unw_is_ark_managed_frame(c)) { - dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X29], &c->dwarf.fp); - char buf[128] = {0}; - ret = unw_step_ark_managed_native_frame(c->dwarf.as->pid == -1 ? getpid() : c->dwarf.as->pid, - (uintptr_t*)&(c->dwarf.ip), (uintptr_t*)&(c->dwarf.fp), (uintptr_t*)&(c->dwarf.cfa), buf, 128); - if (ret > 0) { - c->dwarf.loc[UNW_AARCH64_X29] = DWARF_LOC(c->dwarf.fp, 0); - c->dwarf.loc[UNW_AARCH64_PC] = DWARF_LOC(c->dwarf.fp + 8, 0); - } - } -#endif - if (ret <= 0 && c->dwarf.index == 0) + return aarch64_handle_signal_frame (cursor); + else if (unlikely (ret < 0)) { /* IP points to non-mapped memory. */ /* This is probably SIGBUS. */ /* Try to load LR in IP to recover. */ Debug(1, "Invalid address found in the call stack: 0x%lx\n", c->dwarf.ip); - unw_word_t lr; - dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X30], &lr); - lr = clear_ptrauth(lr); - if (lr != c->dwarf.ip) { - ret = 1; - c->dwarf.ip = lr; - } + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X30], &c->dwarf.ip); } + ret = dwarf_step (&c->dwarf); + Debug(1, "dwarf_step()=%d\n", ret); + + /* Restore default memory validation state */ + c->validate = validate; + + if (unlikely (ret == -UNW_ESTOPUNWIND)) + return ret; + if (unlikely (ret < 0)) { /* DWARF failed. */ + + /* + * We could get here because of missing/bad unwind information. + * Validate all addresses before dereferencing. + */ + if (c->dwarf.as == unw_local_addr_space) + { + c->validate = 1; + } + if (is_plt_entry (&c->dwarf)) { Debug (2, "found plt entry\n"); c->frame_info.frame_type = UNW_AARCH64_FRAME_STANDARD; - /* Use link register (X30). */ - c->frame_info.cfa_reg_offset = 0; - c->frame_info.cfa_reg_sp = 0; - c->frame_info.fp_cfa_offset = -1; - c->frame_info.lr_cfa_offset = -1; - c->frame_info.sp_cfa_offset = -1; - c->dwarf.loc[UNW_AARCH64_PC] = c->dwarf.loc[UNW_AARCH64_X30]; - c->dwarf.loc[UNW_AARCH64_X30] = DWARF_NULL_LOC; - if (!DWARF_IS_NULL_LOC (c->dwarf.loc[UNW_AARCH64_PC])) - { - ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); - if (ret < 0) - { - Debug (2, "failed to get pc from link register: %d\n", ret); - return ret; - } - Debug (2, "link register (x30) = 0x%016lx\n", c->dwarf.ip); - c->dwarf.ip = clear_ptrauth(c->dwarf.ip); - ret = 1; - } - else - c->dwarf.ip = 0; } - else if (c->dwarf.index < 10) + else { Debug (2, "fallback\n"); c->frame_info.frame_type = UNW_AARCH64_FRAME_GUESSED; - ret = step_by_frame_pointer(c); } + /* Use link register (X30). */ + c->frame_info.cfa_reg_offset = 0; + c->frame_info.cfa_reg_sp = 0; + c->frame_info.fp_cfa_offset = -1; + c->frame_info.lr_cfa_offset = -1; + c->frame_info.sp_cfa_offset = -1; + c->dwarf.loc[UNW_AARCH64_PC] = c->dwarf.loc[UNW_AARCH64_X30]; + c->dwarf.loc[UNW_AARCH64_X30] = DWARF_NULL_LOC; + if (!DWARF_IS_NULL_LOC (c->dwarf.loc[UNW_AARCH64_PC])) + { + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); + if (ret < 0) + { + Debug (2, "failed to get pc from link register: %d\n", ret); + return ret; + } + Debug (2, "link register (x30) = 0x%016lx\n", c->dwarf.ip); + ret = 1; + } + else + c->dwarf.ip = 0; } - c->dwarf.index++; - if (ret > 0) - return ret; - return (c->dwarf.ip == 0) ? 0 : 1; } - diff --git a/src/aarch64/Gtrace.c b/libunwind/src/aarch64/Gtrace.c similarity index 100% rename from src/aarch64/Gtrace.c rename to libunwind/src/aarch64/Gtrace.c diff --git a/src/aarch64/Lapply_reg_state.c b/libunwind/src/aarch64/Lapply_reg_state.c similarity index 100% rename from src/aarch64/Lapply_reg_state.c rename to libunwind/src/aarch64/Lapply_reg_state.c diff --git a/src/aarch64/Lcreate_addr_space.c b/libunwind/src/aarch64/Lcreate_addr_space.c similarity index 100% rename from src/aarch64/Lcreate_addr_space.c rename to libunwind/src/aarch64/Lcreate_addr_space.c diff --git a/src/aarch64/Lget_proc_info.c b/libunwind/src/aarch64/Lget_proc_info.c similarity index 100% rename from src/aarch64/Lget_proc_info.c rename to libunwind/src/aarch64/Lget_proc_info.c diff --git a/src/aarch64/Lget_save_loc.c b/libunwind/src/aarch64/Lget_save_loc.c similarity index 100% rename from src/aarch64/Lget_save_loc.c rename to libunwind/src/aarch64/Lget_save_loc.c diff --git a/src/aarch64/Lglobal.c b/libunwind/src/aarch64/Lglobal.c similarity index 100% rename from src/aarch64/Lglobal.c rename to libunwind/src/aarch64/Lglobal.c diff --git a/src/aarch64/Linit.c b/libunwind/src/aarch64/Linit.c similarity index 100% rename from src/aarch64/Linit.c rename to libunwind/src/aarch64/Linit.c diff --git a/src/aarch64/Linit_local.c b/libunwind/src/aarch64/Linit_local.c similarity index 100% rename from src/aarch64/Linit_local.c rename to libunwind/src/aarch64/Linit_local.c diff --git a/src/aarch64/Linit_remote.c b/libunwind/src/aarch64/Linit_remote.c similarity index 100% rename from src/aarch64/Linit_remote.c rename to libunwind/src/aarch64/Linit_remote.c diff --git a/src/aarch64/Lis_signal_frame.c b/libunwind/src/aarch64/Lis_signal_frame.c similarity index 100% rename from src/aarch64/Lis_signal_frame.c rename to libunwind/src/aarch64/Lis_signal_frame.c diff --git a/src/aarch64/Lreg_states_iterate.c b/libunwind/src/aarch64/Lreg_states_iterate.c similarity index 100% rename from src/aarch64/Lreg_states_iterate.c rename to libunwind/src/aarch64/Lreg_states_iterate.c diff --git a/src/aarch64/Lregs.c b/libunwind/src/aarch64/Lregs.c similarity index 100% rename from src/aarch64/Lregs.c rename to libunwind/src/aarch64/Lregs.c diff --git a/src/aarch64/Lresume.c b/libunwind/src/aarch64/Lresume.c similarity index 100% rename from src/aarch64/Lresume.c rename to libunwind/src/aarch64/Lresume.c diff --git a/src/aarch64/Lstash_frame.c b/libunwind/src/aarch64/Lstash_frame.c similarity index 100% rename from src/aarch64/Lstash_frame.c rename to libunwind/src/aarch64/Lstash_frame.c diff --git a/src/aarch64/Lstep.c b/libunwind/src/aarch64/Lstep.c similarity index 100% rename from src/aarch64/Lstep.c rename to libunwind/src/aarch64/Lstep.c diff --git a/src/aarch64/Ltrace.c b/libunwind/src/aarch64/Ltrace.c similarity index 100% rename from src/aarch64/Ltrace.c rename to libunwind/src/aarch64/Ltrace.c diff --git a/src/aarch64/getcontext.S b/libunwind/src/aarch64/getcontext.S similarity index 100% rename from src/aarch64/getcontext.S rename to libunwind/src/aarch64/getcontext.S diff --git a/src/aarch64/init.h b/libunwind/src/aarch64/init.h similarity index 99% rename from src/aarch64/init.h rename to libunwind/src/aarch64/init.h index 74f63adc..5dab60bb 100644 --- a/src/aarch64/init.h +++ b/libunwind/src/aarch64/init.h @@ -121,8 +121,6 @@ common_init (struct cursor *c, unsigned use_prev_instr) c->dwarf.pi_is_dynamic = 0; c->dwarf.hint = 0; c->dwarf.prev_rs = 0; - c->dwarf.index = 0; - c->dwarf.reg_sz = 0; return 0; } diff --git a/src/aarch64/is_fpreg.c b/libunwind/src/aarch64/is_fpreg.c similarity index 100% rename from src/aarch64/is_fpreg.c rename to libunwind/src/aarch64/is_fpreg.c diff --git a/src/aarch64/offsets.h b/libunwind/src/aarch64/offsets.h similarity index 100% rename from src/aarch64/offsets.h rename to libunwind/src/aarch64/offsets.h diff --git a/src/aarch64/regname.c b/libunwind/src/aarch64/regname.c similarity index 100% rename from src/aarch64/regname.c rename to libunwind/src/aarch64/regname.c diff --git a/src/aarch64/siglongjmp.S b/libunwind/src/aarch64/siglongjmp.S similarity index 100% rename from src/aarch64/siglongjmp.S rename to libunwind/src/aarch64/siglongjmp.S diff --git a/src/aarch64/unwind_i.h b/libunwind/src/aarch64/unwind_i.h similarity index 97% rename from src/aarch64/unwind_i.h rename to libunwind/src/aarch64/unwind_i.h index 490d5a53..db7e29dd 100644 --- a/src/aarch64/unwind_i.h +++ b/libunwind/src/aarch64/unwind_i.h @@ -42,7 +42,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define aarch64_lock UNW_OBJ(lock) #define aarch64_local_resume UNW_OBJ(local_resume) #define aarch64_local_addr_space_init UNW_OBJ(local_addr_space_init) -#define init_local_addr_space UNW_OBJ(init_local_addr_space) extern void aarch64_local_addr_space_init (void); extern int aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, diff --git a/src/arm/Gapply_reg_state.c b/libunwind/src/arm/Gapply_reg_state.c similarity index 100% rename from src/arm/Gapply_reg_state.c rename to libunwind/src/arm/Gapply_reg_state.c diff --git a/src/arm/Gcreate_addr_space.c b/libunwind/src/arm/Gcreate_addr_space.c similarity index 97% rename from src/arm/Gcreate_addr_space.c rename to libunwind/src/arm/Gcreate_addr_space.c index 6dd6e1e8..d4bdb416 100644 --- a/src/arm/Gcreate_addr_space.c +++ b/libunwind/src/arm/Gcreate_addr_space.c @@ -47,8 +47,7 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order) memset (as, 0, sizeof (*as)); as->acc = *a; - as->cursor = NULL; - as->pid = -1; + /* Default to little-endian for ARM. */ if (byte_order == 0 || byte_order == UNW_LITTLE_ENDIAN) as->big_endian = 0; diff --git a/src/arm/Gex_tables.c b/libunwind/src/arm/Gex_tables.c similarity index 96% rename from src/arm/Gex_tables.c rename to libunwind/src/arm/Gex_tables.c index a0ef3741..efdcf297 100644 --- a/src/arm/Gex_tables.c +++ b/libunwind/src/arm/Gex_tables.c @@ -361,10 +361,6 @@ arm_exidx_extract (struct dwarf_cursor *c, uint8_t *buf) extbl_data += 8; } assert (n_table_words <= 5); - if(n_table_words > 5) { - Debug (2, "n_table_words is %d will be crash the stack\n",n_table_words); - return -UNW_EINVAL; - } unsigned j; for (j = 0; j < n_table_words; j++) { @@ -510,20 +506,18 @@ arm_phdr_cb (struct dl_phdr_info *info, size_t size, void *data) } HIDDEN int -arm_find_proc_info2 (unw_addr_space_t as, unw_word_t ip, - unw_proc_info_t *pi, int need_unwind_info, void *arg, - int methods) +arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, void *arg) { int ret = -1; intrmask_t saved_mask; Debug (14, "looking for IP=0x%lx\n", (long) ip); - if (UNW_TRY_METHOD (UNW_ARM_METHOD_DWARF) && (methods & UNW_ARM_METHOD_DWARF)) + if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) ret = dwarf_find_proc_info (as, ip, pi, need_unwind_info, arg); - if (ret < 0 && UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX) && - (methods & UNW_ARM_METHOD_EXIDX)) + if (ret < 0 && UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) { struct arm_cb_data cb_data; @@ -546,14 +540,6 @@ arm_find_proc_info2 (unw_addr_space_t as, unw_word_t ip, return ret; } -HIDDEN int -arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, - unw_proc_info_t *pi, int need_unwind_info, void *arg) -{ - return arm_find_proc_info2 (as, ip, pi, need_unwind_info, arg, - UNW_ARM_METHOD_ALL); -} - HIDDEN void arm_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) { diff --git a/src/arm/Gget_proc_info.c b/libunwind/src/arm/Gget_proc_info.c similarity index 100% rename from src/arm/Gget_proc_info.c rename to libunwind/src/arm/Gget_proc_info.c diff --git a/src/arm/Gget_save_loc.c b/libunwind/src/arm/Gget_save_loc.c similarity index 100% rename from src/arm/Gget_save_loc.c rename to libunwind/src/arm/Gget_save_loc.c diff --git a/src/arm/Gglobal.c b/libunwind/src/arm/Gglobal.c similarity index 98% rename from src/arm/Gglobal.c rename to libunwind/src/arm/Gglobal.c index efb3cce5..0700f930 100644 --- a/src/arm/Gglobal.c +++ b/libunwind/src/arm/Gglobal.c @@ -61,7 +61,6 @@ tdep_init (void) dwarf_init (); #ifndef UNW_REMOTE_ONLY - tdep_init_mem_validate (); arm_local_addr_space_init (); #endif atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ diff --git a/src/arm/Ginit.c b/libunwind/src/arm/Ginit.c similarity index 53% rename from src/arm/Ginit.c rename to libunwind/src/arm/Ginit.c index c10d9f3e..0bac0d72 100644 --- a/src/arm/Ginit.c +++ b/libunwind/src/arm/Ginit.c @@ -22,12 +22,8 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include #include #include -#include -#include -#include #include "unwind_i.h" @@ -37,13 +33,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ unw_addr_space_t unw_local_addr_space; #else /* !UNW_REMOTE_ONLY */ -#ifndef NO_RESERVE_CACHE + static struct unw_addr_space local_addr_space; unw_addr_space_t unw_local_addr_space = &local_addr_space; -#else -unw_addr_space_t unw_local_addr_space; -#endif static inline void * uc_addr (unw_tdep_context_t *uc, int reg) @@ -81,217 +74,15 @@ get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, #define PAGE_SIZE 4096 #define PAGE_START(a) ((a) & ~(PAGE_SIZE-1)) -static int mem_validate_pipe[2] = {-1, -1}; - -#ifdef HAVE_PIPE2 -static inline void -do_pipe2 (int pipefd[2]) -{ - pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); -} -#else -static inline void -set_pipe_flags (int fd) -{ - int fd_flags = fcntl (fd, F_GETFD, 0); - int status_flags = fcntl (fd, F_GETFL, 0); - - fd_flags |= FD_CLOEXEC; - fcntl (fd, F_SETFD, fd_flags); - - status_flags |= O_NONBLOCK; - fcntl (fd, F_SETFL, status_flags); -} - -static inline void -do_pipe2 (int pipefd[2]) -{ - pipe (pipefd); - set_pipe_flags(pipefd[0]); - set_pipe_flags(pipefd[1]); -} -#endif - -static inline void -open_pipe (void) -{ - if (mem_validate_pipe[0] != -1) - close (mem_validate_pipe[0]); - if (mem_validate_pipe[1] != -1) - close (mem_validate_pipe[1]); - - do_pipe2 (mem_validate_pipe); -} - -ALWAYS_INLINE -static int -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -__attribute__((no_sanitize("address"))) -#endif -#endif -write_validate (void *addr) -{ - int ret = -1; - ssize_t bytes = 0; - - do - { - char buf; - bytes = syscall(SYS_read, mem_validate_pipe[0], &buf, 1); - } - while ( errno == EINTR ); - - int valid_read = (bytes > 0 || errno == EAGAIN || errno == EWOULDBLOCK); - if (!valid_read) - { - // re-open closed pipe - open_pipe (); - } - - do - { - ret = syscall(SYS_write, mem_validate_pipe[1], addr, 1); - } - while ( errno == EINTR ); - - return ret; -} - -static int (*mem_validate_func) (void *addr, size_t len); -static int msync_validate (void *addr, size_t len) -{ - if (msync (addr, len, MS_ASYNC) != 0) - { - return -1; - } - - return write_validate (addr); -} - -#ifdef HAVE_MINCORE -static int mincore_validate (void *addr, size_t len) -{ - unsigned char mvec[2]; /* Unaligned access may cross page boundary */ - - /* mincore could fail with EAGAIN but we conservatively return -1 - instead of looping. */ - if (mincore (addr, len, (unsigned char *)mvec) != 0) - { - return -1; - } - - return write_validate (addr); -} -#endif - -/* Initialise memory validation method. On linux kernels <2.6.21, - mincore() returns incorrect value for MAP_PRIVATE mappings, - such as stacks. If mincore() was available at compile time, - check if we can actually use it. If not, use msync() instead. */ -HIDDEN void -tdep_init_mem_validate (void) -{ - open_pipe (); - -#ifdef HAVE_MINCORE - unsigned char present = 1; - unw_word_t addr = PAGE_START((unw_word_t)&present); - unsigned char mvec[1]; - int ret; - while ((ret = mincore ((void*)addr, PAGE_SIZE, (unsigned char *)mvec)) == -1 && - errno == EAGAIN) {} - if (ret == 0) - { - Debug(1, "using mincore to validate memory\n"); - mem_validate_func = mincore_validate; - } - else -#endif - { - Debug(1, "using msync to validate memory\n"); - mem_validate_func = msync_validate; - } -} - /* Cache of already validated addresses */ #define NLGA 4 -#if defined(HAVE___CACHE_PER_THREAD) && HAVE___CACHE_PER_THREAD -// thread-local variant -static _Thread_local unw_word_t last_good_addr[NLGA]; -static _Thread_local int lga_victim; - -static int -is_cached_valid_mem(unw_word_t addr) -{ - int i; - for (i = 0; i < NLGA; i++) - { - if (addr == last_good_addr[i]) - return 1; - } - return 0; - } - -static void -cache_valid_mem(unw_word_t addr) -{ - int i, victim; - victim = lga_victim; - for (i = 0; i < NLGA; i++) { - if (last_good_addr[victim] == 0) { - last_good_addr[victim] = addr; - return; - } - victim = (victim + 1) % NLGA; - } - - /* All slots full. Evict the victim. */ - last_good_addr[victim] = addr; - victim = (victim + 1) % NLGA; - lga_victim = victim; -} - -#else -// global, thread safe variant -static _Atomic unw_word_t last_good_addr[NLGA]; -static _Atomic int lga_victim; - -static int -is_cached_valid_mem(unw_word_t addr) -{ - int i; - for (i = 0; i < NLGA; i++) - { - if (addr == atomic_load(&last_good_addr[i])) - return 1; - } - return 0; -} - -static void -cache_valid_mem(unw_word_t addr) -{ - int i, victim; - victim = atomic_load(&lga_victim); - unw_word_t zero = 0; - for (i = 0; i < NLGA; i++) { - if (atomic_compare_exchange_strong(&last_good_addr[victim], &zero, addr)) { - return; - } - victim = (victim + 1) % NLGA; - } - - /* All slots full. Evict the victim. */ - atomic_store(&last_good_addr[victim], addr); - victim = (victim + 1) % NLGA; - atomic_store(&lga_victim, victim); -} -#endif +static unw_word_t last_good_addr[NLGA]; +static int lga_victim; static int validate_mem (unw_word_t addr) { + int i, victim; size_t len; if (PAGE_START(addr + sizeof (unw_word_t) - 1) == PAGE_START(addr)) @@ -302,15 +93,30 @@ validate_mem (unw_word_t addr) addr = PAGE_START(addr); if (addr == 0) - return -1; - - if (is_cached_valid_mem(addr)) - return 0; - - if (mem_validate_func ((void *) addr, len) == -1) return -1; - cache_valid_mem(addr); + for (i = 0; i < NLGA; i++) + { + if (last_good_addr[i] && (addr == last_good_addr[i])) + return 0; + } + + if (msync ((void *) addr, len, MS_ASYNC) == -1) + return -1; + + victim = lga_victim; + for (i = 0; i < NLGA; i++) { + if (!last_good_addr[victim]) { + last_good_addr[victim++] = addr; + return 0; + } + victim = (victim + 1) % NLGA; + } + + /* All slots full. Evict the victim. */ + last_good_addr[victim] = addr; + victim = (victim + 1) % NLGA; + lga_victim = victim; return 0; } @@ -412,9 +218,8 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, HIDDEN void arm_local_addr_space_init (void) { -#ifndef NO_RESERVE_CACHE memset (&local_addr_space, 0, sizeof (local_addr_space)); - local_addr_space.caching_policy = UNW_CACHE_NONE; + local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; local_addr_space.acc.find_proc_info = arm_find_proc_info; local_addr_space.acc.put_unwind_info = arm_put_unwind_info; local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; @@ -424,23 +229,6 @@ arm_local_addr_space_init (void) local_addr_space.acc.resume = arm_local_resume; local_addr_space.acc.get_proc_name = get_static_proc_name; unw_flush_cache (&local_addr_space, 0, 0); -#endif -} - -HIDDEN void -init_local_addr_space (unw_addr_space_t as) -{ - memset (as, 0, sizeof (struct unw_addr_space)); - as->caching_policy = UNW_CACHE_NONE; - as->acc.find_proc_info = arm_find_proc_info; - as->acc.put_unwind_info = arm_put_unwind_info; - as->acc.get_dyn_info_list_addr = get_dyn_info_list_addr; - as->acc.access_mem = access_mem; - as->acc.access_reg = access_reg; - as->acc.access_fpreg = access_fpreg; - as->acc.resume = arm_local_resume; - as->acc.get_proc_name = get_static_proc_name; - unw_flush_cache (as, 0, 0); } #endif /* !UNW_REMOTE_ONLY */ diff --git a/src/arm/Ginit_local.c b/libunwind/src/arm/Ginit_local.c similarity index 77% rename from src/arm/Ginit_local.c rename to libunwind/src/arm/Ginit_local.c index c8b09fbd..8679805d 100644 --- a/src/arm/Ginit_local.c +++ b/libunwind/src/arm/Ginit_local.c @@ -48,36 +48,10 @@ unw_init_local_common (unw_cursor_t *cursor, unw_context_t *uc, unsigned use_pre c->dwarf.as = unw_local_addr_space; c->dwarf.as_arg = uc; - c->dwarf.as->pid = -1; - c->dwarf.as->cursor = c; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; + return common_init (c, use_prev_instr); } -int -unw_init_local_with_as(unw_addr_space_t as, unw_cursor_t *cursor, unw_context_t *uc) -{ - struct cursor *c = (struct cursor *) cursor; - - if (!atomic_load(&tdep_init_done)) - tdep_init (); - - Debug (1, "(cursor=%p)\n", c); -#ifdef NO_RESERVE_CACHE - unw_local_addr_space = as; -#endif - c->dwarf.as = as; - c->dwarf.as_arg = uc; - c->dwarf.as->pid = -1; - c->dwarf.as->cursor = c; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; - return common_init (c, 1); -} - int unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) { diff --git a/src/mips/Ginit_remote.c b/libunwind/src/arm/Ginit_remote.c similarity index 100% rename from src/mips/Ginit_remote.c rename to libunwind/src/arm/Ginit_remote.c diff --git a/src/arm/Gos-freebsd.c b/libunwind/src/arm/Gos-freebsd.c similarity index 97% rename from src/arm/Gos-freebsd.c rename to libunwind/src/arm/Gos-freebsd.c index 1566a813..a1069223 100644 --- a/src/arm/Gos-freebsd.c +++ b/libunwind/src/arm/Gos-freebsd.c @@ -38,7 +38,7 @@ HIDDEN int arm_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; - int i, ret, fmt; + int ret, fmt; unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); @@ -70,9 +70,6 @@ arm_handle_signal_frame (unw_cursor_t *cursor) c->frame_info.frame_type = UNW_ARM_FRAME_SIGRETURN; c->frame_info.cfa_reg_offset = sc_addr - sp_addr; - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - /* Update the dwarf cursor. Set the location of the registers to the corresponding addresses of the uc_mcontext / sigcontext structure contents. */ diff --git a/src/arm/Gos-linux.c b/libunwind/src/arm/Gos-linux.c similarity index 98% rename from src/arm/Gos-linux.c rename to libunwind/src/arm/Gos-linux.c index 19703030..260e086f 100644 --- a/src/arm/Gos-linux.c +++ b/libunwind/src/arm/Gos-linux.c @@ -33,7 +33,7 @@ HIDDEN int arm_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; - int i, ret; + int ret; unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); @@ -93,9 +93,6 @@ arm_handle_signal_frame (unw_cursor_t *cursor) c->frame_info.frame_type = UNW_ARM_FRAME_SIGRETURN; c->frame_info.cfa_reg_offset = sc_addr - sp_addr; - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - /* Update the dwarf cursor. Set the location of the registers to the corresponding addresses of the uc_mcontext / sigcontext structure contents. */ diff --git a/src/arm/Gos-other.c b/libunwind/src/arm/Gos-other.c similarity index 100% rename from src/arm/Gos-other.c rename to libunwind/src/arm/Gos-other.c diff --git a/src/arm/Greg_states_iterate.c b/libunwind/src/arm/Greg_states_iterate.c similarity index 100% rename from src/arm/Greg_states_iterate.c rename to libunwind/src/arm/Greg_states_iterate.c diff --git a/src/arm/Gregs.c b/libunwind/src/arm/Gregs.c similarity index 100% rename from src/arm/Gregs.c rename to libunwind/src/arm/Gregs.c diff --git a/src/arm/Gresume.c b/libunwind/src/arm/Gresume.c similarity index 100% rename from src/arm/Gresume.c rename to libunwind/src/arm/Gresume.c diff --git a/src/arm/Gstash_frame.c b/libunwind/src/arm/Gstash_frame.c similarity index 100% rename from src/arm/Gstash_frame.c rename to libunwind/src/arm/Gstash_frame.c diff --git a/src/arm/Gstep.c b/libunwind/src/arm/Gstep.c similarity index 86% rename from src/arm/Gstep.c rename to libunwind/src/arm/Gstep.c index 21b7a0f0..895e8a89 100644 --- a/src/arm/Gstep.c +++ b/libunwind/src/arm/Gstep.c @@ -30,8 +30,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include -#include "map_info.h" - #define arm_exidx_step UNW_OBJ(arm_exidx_step) static inline int @@ -56,22 +54,17 @@ arm_exidx_step (struct cursor *c) c->dwarf.as_arg); if (ret == -UNW_ENOINFO) { -#ifdef UNW_LOCAL_ONLY - if ((ret = arm_find_proc_info2 (c->dwarf.as, ip, &c->dwarf.pi, - 1, c->dwarf.as_arg, - UNW_ARM_METHOD_EXIDX)) < 0) - return ret; -#else if ((ret = tdep_find_proc_info (&c->dwarf, ip, 1)) < 0) return ret; -#endif } if (c->dwarf.pi.format != UNW_INFO_FORMAT_ARM_EXIDX) return -UNW_ENOINFO; ret = arm_exidx_extract (&c->dwarf, buf); - if (ret < 0) + if (ret == -UNW_ESTOPUNWIND) + return 0; + else if (ret < 0) return ret; ret = arm_exidx_decode (buf, ret, &c->dwarf); @@ -80,7 +73,7 @@ arm_exidx_step (struct cursor *c) if (c->dwarf.ip == old_ip && c->dwarf.cfa == old_cfa) { - Debug (1, "%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n", + Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n", __FUNCTION__, (long) c->dwarf.ip); return -UNW_EBADFRAME; } @@ -99,9 +92,8 @@ unw_step (unw_cursor_t *cursor) Debug (1, "(cursor=%p)\n", c); /* Check if this is a signal frame. */ - if (unw_is_signal_frame (cursor) > 0){ - ret = arm_handle_signal_frame (cursor); - } + if (unw_is_signal_frame (cursor) > 0) + return arm_handle_signal_frame (cursor); #ifdef CONFIG_DEBUG_FRAME /* First, try DWARF-based unwinding. */ @@ -130,24 +122,18 @@ unw_step (unw_cursor_t *cursor) UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF) ? "dwarf_step() failed " : "", ret); ret = arm_exidx_step (c); + if (ret > 0) + return 1; + if (ret == -UNW_ESTOPUNWIND || ret == 0) + return ret; } - if (ret <= 0 && c->dwarf.index == 0) { - // same with aarch64 - unw_word_t lr; - if (dwarf_get(&c->dwarf, c->dwarf.loc[UNW_ARM_R14], &lr) >= 0) { - if (lr != c->dwarf.ip) { - c->dwarf.ip = lr; - ret = 1; - } - } - } /* Fall back on APCS frame parsing. Note: This won't work in case the ARM EABI is used. */ #ifdef __FreeBSD__ if (0) #else - if (unlikely (ret < 0) && (c->dwarf.index < 3)) + if (unlikely (ret < 0)) #endif { if (UNW_TRY_METHOD(UNW_ARM_METHOD_FRAME)) @@ -175,7 +161,6 @@ unw_step (unw_cursor_t *cursor) } if (frame) { -#ifndef CC_IS_CLANG if (dwarf_get(&c->dwarf, DWARF_LOC(frame, 0), &instr) < 0) { return 0; @@ -197,10 +182,6 @@ unw_step (unw_cursor_t *cursor) ip_loc = DWARF_LOC(frame, 0); fp_loc = DWARF_LOC(frame - 4, 0); } -#else - ip_loc = DWARF_LOC(frame + 4, 0); - fp_loc = DWARF_LOC(frame, 0); -#endif if (dwarf_get(&c->dwarf, ip_loc, &c->dwarf.ip) < 0) { return 0; @@ -208,7 +189,6 @@ unw_step (unw_cursor_t *cursor) c->dwarf.loc[UNW_ARM_R12] = ip_loc; c->dwarf.loc[UNW_ARM_R11] = fp_loc; c->dwarf.pi_valid = 0; - ret = 1; Debug(15, "ip=%x\n", c->dwarf.ip); } else @@ -217,7 +197,5 @@ unw_step (unw_cursor_t *cursor) } } } - - c->dwarf.index++; return ret == -UNW_ENOINFO ? 0 : ret; } diff --git a/src/arm/Gtrace.c b/libunwind/src/arm/Gtrace.c similarity index 99% rename from src/arm/Gtrace.c rename to libunwind/src/arm/Gtrace.c index fa479117..51fc281d 100644 --- a/src/arm/Gtrace.c +++ b/libunwind/src/arm/Gtrace.c @@ -28,7 +28,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "offsets.h" #include #include -#include #pragma weak pthread_once #pragma weak pthread_key_create diff --git a/src/arm/Lapply_reg_state.c b/libunwind/src/arm/Lapply_reg_state.c similarity index 100% rename from src/arm/Lapply_reg_state.c rename to libunwind/src/arm/Lapply_reg_state.c diff --git a/src/arm/Lcreate_addr_space.c b/libunwind/src/arm/Lcreate_addr_space.c similarity index 100% rename from src/arm/Lcreate_addr_space.c rename to libunwind/src/arm/Lcreate_addr_space.c diff --git a/src/arm/Lex_tables.c b/libunwind/src/arm/Lex_tables.c similarity index 100% rename from src/arm/Lex_tables.c rename to libunwind/src/arm/Lex_tables.c diff --git a/src/arm/Lget_proc_info.c b/libunwind/src/arm/Lget_proc_info.c similarity index 100% rename from src/arm/Lget_proc_info.c rename to libunwind/src/arm/Lget_proc_info.c diff --git a/src/arm/Lget_save_loc.c b/libunwind/src/arm/Lget_save_loc.c similarity index 100% rename from src/arm/Lget_save_loc.c rename to libunwind/src/arm/Lget_save_loc.c diff --git a/src/arm/Lglobal.c b/libunwind/src/arm/Lglobal.c similarity index 100% rename from src/arm/Lglobal.c rename to libunwind/src/arm/Lglobal.c diff --git a/src/arm/Linit.c b/libunwind/src/arm/Linit.c similarity index 100% rename from src/arm/Linit.c rename to libunwind/src/arm/Linit.c diff --git a/src/arm/Linit_local.c b/libunwind/src/arm/Linit_local.c similarity index 100% rename from src/arm/Linit_local.c rename to libunwind/src/arm/Linit_local.c diff --git a/src/arm/Linit_remote.c b/libunwind/src/arm/Linit_remote.c similarity index 100% rename from src/arm/Linit_remote.c rename to libunwind/src/arm/Linit_remote.c diff --git a/src/arm/Los-freebsd.c b/libunwind/src/arm/Los-freebsd.c similarity index 100% rename from src/arm/Los-freebsd.c rename to libunwind/src/arm/Los-freebsd.c diff --git a/src/arm/Los-linux.c b/libunwind/src/arm/Los-linux.c similarity index 100% rename from src/arm/Los-linux.c rename to libunwind/src/arm/Los-linux.c diff --git a/src/arm/Los-other.c b/libunwind/src/arm/Los-other.c similarity index 100% rename from src/arm/Los-other.c rename to libunwind/src/arm/Los-other.c diff --git a/src/arm/Lreg_states_iterate.c b/libunwind/src/arm/Lreg_states_iterate.c similarity index 100% rename from src/arm/Lreg_states_iterate.c rename to libunwind/src/arm/Lreg_states_iterate.c diff --git a/src/arm/Lregs.c b/libunwind/src/arm/Lregs.c similarity index 100% rename from src/arm/Lregs.c rename to libunwind/src/arm/Lregs.c diff --git a/src/arm/Lresume.c b/libunwind/src/arm/Lresume.c similarity index 100% rename from src/arm/Lresume.c rename to libunwind/src/arm/Lresume.c diff --git a/src/arm/Lstash_frame.c b/libunwind/src/arm/Lstash_frame.c similarity index 100% rename from src/arm/Lstash_frame.c rename to libunwind/src/arm/Lstash_frame.c diff --git a/src/arm/Lstep.c b/libunwind/src/arm/Lstep.c similarity index 100% rename from src/arm/Lstep.c rename to libunwind/src/arm/Lstep.c diff --git a/src/arm/Ltrace.c b/libunwind/src/arm/Ltrace.c similarity index 100% rename from src/arm/Ltrace.c rename to libunwind/src/arm/Ltrace.c diff --git a/src/arm/getcontext.S b/libunwind/src/arm/getcontext.S similarity index 100% rename from src/arm/getcontext.S rename to libunwind/src/arm/getcontext.S diff --git a/src/arm/init.h b/libunwind/src/arm/init.h similarity index 98% rename from src/arm/init.h rename to libunwind/src/arm/init.h index adbe5eaf..7d765ecf 100644 --- a/src/arm/init.h +++ b/libunwind/src/arm/init.h @@ -72,8 +72,6 @@ common_init (struct cursor *c, unsigned use_prev_instr) c->dwarf.pi_is_dynamic = 0; c->dwarf.hint = 0; c->dwarf.prev_rs = 0; - c->dwarf.index = 0; - c->dwarf.reg_sz = 0; return 0; } diff --git a/src/arm/is_fpreg.c b/libunwind/src/arm/is_fpreg.c similarity index 100% rename from src/arm/is_fpreg.c rename to libunwind/src/arm/is_fpreg.c diff --git a/src/arm/offsets.h b/libunwind/src/arm/offsets.h similarity index 100% rename from src/arm/offsets.h rename to libunwind/src/arm/offsets.h diff --git a/src/arm/regname.c b/libunwind/src/arm/regname.c similarity index 100% rename from src/arm/regname.c rename to libunwind/src/arm/regname.c diff --git a/src/arm/siglongjmp.S b/libunwind/src/arm/siglongjmp.S similarity index 100% rename from src/arm/siglongjmp.S rename to libunwind/src/arm/siglongjmp.S diff --git a/src/arm/unwind_i.h b/libunwind/src/arm/unwind_i.h similarity index 97% rename from src/arm/unwind_i.h rename to libunwind/src/arm/unwind_i.h index d5023b42..fe0bca00 100644 --- a/src/arm/unwind_i.h +++ b/libunwind/src/arm/unwind_i.h @@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define arm_lock UNW_OBJ(lock) #define arm_local_resume UNW_OBJ(local_resume) #define arm_local_addr_space_init UNW_OBJ(local_addr_space_init) -#define init_local_addr_space UNW_OBJ(init_local_addr_space) extern void arm_local_addr_space_init (void); extern int arm_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, diff --git a/src/coredump/_UCD_access_mem.c b/libunwind/src/coredump/_UCD_access_mem.c similarity index 100% rename from src/coredump/_UCD_access_mem.c rename to libunwind/src/coredump/_UCD_access_mem.c diff --git a/src/coredump/_UCD_access_reg_freebsd.c b/libunwind/src/coredump/_UCD_access_reg_freebsd.c similarity index 100% rename from src/coredump/_UCD_access_reg_freebsd.c rename to libunwind/src/coredump/_UCD_access_reg_freebsd.c diff --git a/src/coredump/_UCD_access_reg_linux.c b/libunwind/src/coredump/_UCD_access_reg_linux.c similarity index 100% rename from src/coredump/_UCD_access_reg_linux.c rename to libunwind/src/coredump/_UCD_access_reg_linux.c diff --git a/src/coredump/_UCD_accessors.c b/libunwind/src/coredump/_UCD_accessors.c similarity index 100% rename from src/coredump/_UCD_accessors.c rename to libunwind/src/coredump/_UCD_accessors.c diff --git a/src/coredump/_UCD_corefile_elf.c b/libunwind/src/coredump/_UCD_corefile_elf.c similarity index 100% rename from src/coredump/_UCD_corefile_elf.c rename to libunwind/src/coredump/_UCD_corefile_elf.c diff --git a/src/coredump/_UCD_create.c b/libunwind/src/coredump/_UCD_create.c similarity index 100% rename from src/coredump/_UCD_create.c rename to libunwind/src/coredump/_UCD_create.c diff --git a/src/coredump/_UCD_destroy.c b/libunwind/src/coredump/_UCD_destroy.c similarity index 100% rename from src/coredump/_UCD_destroy.c rename to libunwind/src/coredump/_UCD_destroy.c diff --git a/src/coredump/_UCD_elf_map_image.c b/libunwind/src/coredump/_UCD_elf_map_image.c similarity index 100% rename from src/coredump/_UCD_elf_map_image.c rename to libunwind/src/coredump/_UCD_elf_map_image.c diff --git a/src/coredump/_UCD_find_proc_info.c b/libunwind/src/coredump/_UCD_find_proc_info.c similarity index 100% rename from src/coredump/_UCD_find_proc_info.c rename to libunwind/src/coredump/_UCD_find_proc_info.c diff --git a/src/coredump/_UCD_get_mapinfo_generic.c b/libunwind/src/coredump/_UCD_get_mapinfo_generic.c similarity index 100% rename from src/coredump/_UCD_get_mapinfo_generic.c rename to libunwind/src/coredump/_UCD_get_mapinfo_generic.c diff --git a/src/coredump/_UCD_get_mapinfo_linux.c b/libunwind/src/coredump/_UCD_get_mapinfo_linux.c similarity index 100% rename from src/coredump/_UCD_get_mapinfo_linux.c rename to libunwind/src/coredump/_UCD_get_mapinfo_linux.c diff --git a/src/coredump/_UCD_get_proc_name.c b/libunwind/src/coredump/_UCD_get_proc_name.c similarity index 100% rename from src/coredump/_UCD_get_proc_name.c rename to libunwind/src/coredump/_UCD_get_proc_name.c diff --git a/src/coredump/_UCD_get_threadinfo_prstatus.c b/libunwind/src/coredump/_UCD_get_threadinfo_prstatus.c similarity index 100% rename from src/coredump/_UCD_get_threadinfo_prstatus.c rename to libunwind/src/coredump/_UCD_get_threadinfo_prstatus.c diff --git a/src/coredump/_UCD_internal.h b/libunwind/src/coredump/_UCD_internal.h similarity index 100% rename from src/coredump/_UCD_internal.h rename to libunwind/src/coredump/_UCD_internal.h diff --git a/src/coredump/_UCD_lib.h b/libunwind/src/coredump/_UCD_lib.h similarity index 100% rename from src/coredump/_UCD_lib.h rename to libunwind/src/coredump/_UCD_lib.h diff --git a/src/coredump/_UPT_access_fpreg.c b/libunwind/src/coredump/_UPT_access_fpreg.c similarity index 100% rename from src/coredump/_UPT_access_fpreg.c rename to libunwind/src/coredump/_UPT_access_fpreg.c diff --git a/src/coredump/_UPT_elf.c b/libunwind/src/coredump/_UPT_elf.c similarity index 100% rename from src/coredump/_UPT_elf.c rename to libunwind/src/coredump/_UPT_elf.c diff --git a/src/coredump/_UPT_get_dyn_info_list_addr.c b/libunwind/src/coredump/_UPT_get_dyn_info_list_addr.c similarity index 100% rename from src/coredump/_UPT_get_dyn_info_list_addr.c rename to libunwind/src/coredump/_UPT_get_dyn_info_list_addr.c diff --git a/src/coredump/_UPT_put_unwind_info.c b/libunwind/src/coredump/_UPT_put_unwind_info.c similarity index 100% rename from src/coredump/_UPT_put_unwind_info.c rename to libunwind/src/coredump/_UPT_put_unwind_info.c diff --git a/src/coredump/_UPT_resume.c b/libunwind/src/coredump/_UPT_resume.c similarity index 100% rename from src/coredump/_UPT_resume.c rename to libunwind/src/coredump/_UPT_resume.c diff --git a/src/coredump/libunwind-coredump.pc.in b/libunwind/src/coredump/libunwind-coredump.pc.in similarity index 100% rename from src/coredump/libunwind-coredump.pc.in rename to libunwind/src/coredump/libunwind-coredump.pc.in diff --git a/src/dl-iterate-phdr.c b/libunwind/src/dl-iterate-phdr.c similarity index 100% rename from src/dl-iterate-phdr.c rename to libunwind/src/dl-iterate-phdr.c diff --git a/src/dwarf/Gexpr.c b/libunwind/src/dwarf/Gexpr.c similarity index 99% rename from src/dwarf/Gexpr.c rename to libunwind/src/dwarf/Gexpr.c index 882f4dac..963a064d 100644 --- a/src/dwarf/Gexpr.c +++ b/libunwind/src/dwarf/Gexpr.c @@ -265,7 +265,7 @@ if (stackerror) \ return -UNW_EINVAL; \ } -// Removed the parentheses on the assignment +// Removed the parentheses on the asignment // to allow the extra stack error check // when x is evaluated # define push(x) \ @@ -530,7 +530,7 @@ if (stackerror) \ Debug (15, "OP_abs\n"); tmp1 = pop (); if (tmp1 & ((unw_word_t) 1 << (8 * dwarf_addr_size (as) - 1))) - tmp1 = (~tmp1 + 1); + tmp1 = -tmp1; push (tmp1); break; @@ -578,8 +578,7 @@ if (stackerror) \ case DW_OP_neg: Debug (15, "OP_neg\n"); - tmp1 = pop (); - push (~tmp1 + 1); + push (-pop ()); break; case DW_OP_not: diff --git a/src/dwarf/Gfde.c b/libunwind/src/dwarf/Gfde.c similarity index 97% rename from src/dwarf/Gfde.c rename to libunwind/src/dwarf/Gfde.c index fe355e06..9250b895 100644 --- a/src/dwarf/Gfde.c +++ b/libunwind/src/dwarf/Gfde.c @@ -24,7 +24,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "dwarf_i.h" -#define UPDATE_VERSION 3 + static inline int is_cie_id (unw_word_t val, int is_debug_frame) { @@ -48,7 +48,6 @@ parse_cie (unw_addr_space_t as, unw_accessors_t *a, unw_word_t addr, int is_debug_frame, void *arg) { uint8_t version, ch, augstr[5], fde_encoding, handler_encoding; - uint8_t address_size, segment_size; unw_word_t len, cie_end_addr, aug_size; uint32_t u32val; uint64_t u64val; @@ -139,15 +138,6 @@ parse_cie (unw_addr_space_t as, unw_accessors_t *a, unw_word_t addr, augstr[i++] = ch; } - if (version > UPDATE_VERSION) - { - if ((ret = dwarf_readu8(as, a, &addr, &address_size, arg)) < 0) - return ret; - - if ((ret = dwarf_readu8(as, a, &addr, &segment_size, arg)) < 0) - return ret; - } - if ((ret = dwarf_read_uleb128 (as, a, &addr, &dci->code_align, arg)) < 0 || (ret = dwarf_read_sleb128 (as, a, &addr, &dci->data_align, arg)) < 0) return ret; @@ -223,8 +213,8 @@ parse_cie (unw_addr_space_t as, unw_accessors_t *a, unw_word_t addr, return 0; } -/* Extract proc-info from the FDE starting at address ADDR. - +/* Extract proc-info from the FDE starting at adress ADDR. + Pass BASE as zero for eh_frame behaviour, or a pointer to debug_frame base for debug_frame behaviour. */ diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/libunwind/src/dwarf/Gfind_proc_info-lsb.c similarity index 98% rename from src/dwarf/Gfind_proc_info-lsb.c rename to libunwind/src/dwarf/Gfind_proc_info-lsb.c index 8ead48f0..7f170915 100644 --- a/src/dwarf/Gfind_proc_info-lsb.c +++ b/libunwind/src/dwarf/Gfind_proc_info-lsb.c @@ -135,9 +135,9 @@ load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local, #if defined(SHF_COMPRESSED) if (shdr->sh_flags & SHF_COMPRESSED) { + unsigned long destSize; Elf_W (Chdr) *chdr = (shdr->sh_offset + ei.image); #ifdef HAVE_ZLIB - unsigned long destSize; if (chdr->ch_type == ELFCOMPRESS_ZLIB) { *bufsize = destSize = chdr->ch_size; @@ -658,7 +658,7 @@ dwarf_callback (struct dl_phdr_info *info, size_t size, void *ptr) { if (p_dynamic) { - /* For dynamically linked executables and shared libraries, + /* For dynamicly linked executables and shared libraries, DT_PLTGOT is the value that data-relative addresses are relative to for that object. We call this the "gp". */ Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(p_dynamic->p_vaddr + load_base); @@ -866,9 +866,9 @@ remote_lookup (unw_addr_space_t as, unw_word_t table, size_t table_size, int32_t rel_ip, struct table_entry *e, int32_t *last_ip_offset, void *arg) { - size_t table_len = table_size / sizeof (struct table_entry); + unsigned long table_len = table_size / sizeof (struct table_entry); unw_accessors_t *a = unw_get_accessors_int (as); - size_t lo, hi, mid; + unsigned long lo, hi, mid; unw_word_t e_addr = 0; int32_t start = 0; int ret; @@ -910,15 +910,15 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg) { - const struct table_entry *e = NULL, *table = NULL; + const struct table_entry *e = NULL, *table; unw_word_t ip_base = 0, segbase = 0, last_ip, fde_addr; unw_accessors_t *a; #ifndef UNW_LOCAL_ONLY struct table_entry ent; #endif int ret; - unw_word_t debug_frame_base = 0; - size_t table_len = 0; + unw_word_t debug_frame_base; + size_t table_len; #ifdef UNW_REMOTE_ONLY assert (is_remote_table(di->format)); @@ -966,7 +966,7 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip, if (as == unw_local_addr_space) { e = lookup (table, table_len, ip - ip_base - di->load_offset); - if (e && &e[1] < &table[table_len / sizeof (unw_word_t)]) + if (e && &e[1] < &table[table_len]) last_ip = e[1].start_ip_offset + ip_base + di->load_offset; else last_ip = di->end_ip; diff --git a/src/dwarf/Gfind_unwind_table.c b/libunwind/src/dwarf/Gfind_unwind_table.c similarity index 55% rename from src/dwarf/Gfind_unwind_table.c rename to libunwind/src/dwarf/Gfind_unwind_table.c index 449bb442..a6198ad2 100644 --- a/src/dwarf/Gfind_unwind_table.c +++ b/libunwind/src/dwarf/Gfind_unwind_table.c @@ -26,7 +26,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include -#include #include @@ -35,107 +34,51 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "dwarf_i.h" #define to_unw_word(p) ((unw_word_t) (uintptr_t) (p)) -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif - -#ifndef NT_GNU_BUILD_ID -#define NT_GNU_BUILD_ID 3 -#endif - -#ifndef ElfW -#define ElfW(type) Elf_##type -#endif - -#define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1)) int -dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, - unw_addr_space_t as, char *path, - unw_word_t segbase, unw_word_t mapoff, unw_word_t ip) +dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as, + char *path, unw_word_t segbase, unw_word_t mapoff, + unw_word_t ip) { Elf_W(Phdr) *phdr, *ptxt = NULL, *peh_hdr = NULL, *pdyn = NULL; unw_word_t addr, eh_frame_start, fde_count, load_base; - unw_word_t max_load_addr = (unw_word_t)(ei->image) + ei->size; - unw_word_t min_load_addr = (unw_word_t)(ei->image); + unw_word_t max_load_addr = 0; unw_word_t start_ip = to_unw_word (-1); unw_word_t end_ip = 0; struct dwarf_eh_frame_hdr *hdr; unw_proc_info_t pi; unw_accessors_t *a; Elf_W(Ehdr) *ehdr; - int first_load_section = 0; - int first_load_offset = 0; #if UNW_TARGET_ARM - const Elf_W(Phdr) *param_exidx = NULL; + const Elf_W(Phdr) *parm_exidx = NULL; #endif int i, ret, found = 0; /* XXX: Much of this code is Linux/LSB-specific. */ - if (!elf_w(valid_object) (ei)) + + if (!elf_w(valid_object) (&edi->ei)) return -UNW_ENOINFO; - if (path == NULL || strlen(path) > PAGE_SIZE || max_load_addr < min_load_addr) { - return -UNW_ENOINFO; - } + ehdr = edi->ei.image; + phdr = (Elf_W(Phdr) *) ((char *) edi->ei.image + ehdr->e_phoff); - if (ei->has_dyn_info == 1 && - ei->elf_dyn_info.start_ip <= ip && - ei->elf_dyn_info.end_ip >= ip) { - *edi = ei->elf_dyn_info; - return 1; // found - } - - ehdr = ei->image; - phdr = (Elf_W(Phdr) *) ((char *) ei->image + ehdr->e_phoff); - if (((unw_word_t)phdr) + sizeof(Elf_W(Phdr)) > max_load_addr || - ((unw_word_t)phdr) + sizeof(Elf_W(Phdr)) < min_load_addr) { - return -UNW_ENOINFO; - } - -#ifdef PARSE_BUILD_ID - struct build_id_note* note; - int note_len; - size_t note_offset; -#endif - unsigned long pagesize_alignment_mask = ~(((unsigned long)getpagesize()) - 1UL); for (i = 0; i < ehdr->e_phnum; ++i) { - if (((unw_word_t)(&(phdr[i])) + sizeof(Elf_W(Phdr))) > max_load_addr || - ((unw_word_t)(&(phdr[i])) + sizeof(Elf_W(Phdr))) < min_load_addr) { - break; - } - switch (phdr[i].p_type) { case PT_LOAD: - if ((phdr[i].p_flags & PF_X) == 0) { - continue; - } - - if (first_load_section == 0) { - ei->load_bias = phdr[i].p_vaddr - phdr[i].p_offset; - first_load_section = 1; - } - if (phdr[i].p_vaddr < start_ip) start_ip = phdr[i].p_vaddr; if (phdr[i].p_vaddr + phdr[i].p_memsz > end_ip) end_ip = phdr[i].p_vaddr + phdr[i].p_memsz; - if ((phdr[i].p_offset & (-PAGE_SIZE)) == mapoff) + if (phdr[i].p_offset == mapoff) ptxt = phdr + i; - - if (first_load_offset == 0) { - if ((phdr[i].p_offset & pagesize_alignment_mask) == mapoff) { - ei->load_offset = phdr[i].p_vaddr - (phdr[i].p_offset & (~pagesize_alignment_mask)); - first_load_offset = 1; - } else { - ei->load_offset = 0; - } - } + if ((uintptr_t) edi->ei.image + phdr->p_filesz > max_load_addr) + max_load_addr = (uintptr_t) edi->ei.image + phdr->p_filesz; break; + case PT_GNU_EH_FRAME: #if defined __sun case PT_SUNW_UNWIND: @@ -149,42 +92,10 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, #if UNW_TARGET_ARM case PT_ARM_EXIDX: - param_exidx = phdr + i; + parm_exidx = phdr + i; break; #endif -#ifdef PARSE_BUILD_ID - case PT_NOTE: { - note = (void *)(ei->image + phdr[i].p_offset); - note_len = phdr[i].p_filesz; - if (((unw_word_t)note + note_len) > max_load_addr || - ((unw_word_t)note + note_len) < min_load_addr) { - Dprintf("Target Note Section is not valid:%s\n", path); - break; - } - while (note_len >= (int)(sizeof(struct build_id_note))) { - if (note->nhdr.n_type == NT_GNU_BUILD_ID && - note->nhdr.n_descsz != 0 && - note->nhdr.n_namesz == 4 && - memcmp(note->name, "GNU", 4) == 0) { - ei->build_id_note = note; - break; - } - - note_offset = sizeof(ElfW(Nhdr)) + - ALIGN(note->nhdr.n_namesz, 4) + - ALIGN(note->nhdr.n_descsz, 4); - // 05 00 00 00 04 00 00 00 4f 48 4f 53 00 01 00 00 00 00 00 00 - if (note->nhdr.n_type == 0x534f484f && note_len > 20) { - // .note.ohos.ident is not a valid PT_NOTE section, use offset in section header later - note_offset = 20; - } - note = (struct build_id_note*)((char *)note + note_offset); - note_len -= note_offset; - } - } - break; -#endif default: break; } @@ -193,7 +104,7 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, if (!ptxt) return 0; - load_base = segbase - (ptxt->p_vaddr & (-PAGE_SIZE)); + load_base = segbase - ptxt->p_vaddr; start_ip += load_base; end_ip += load_base; @@ -204,18 +115,16 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, /* For dynamicly linked executables and shared libraries, DT_PLTGOT is the value that data-relative addresses are relative to for that object. We call this the "gp". */ - Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(pdyn->p_offset + (char *) ei->image); - while (((unw_word_t)dyn + sizeof(Elf_W(Dyn))) <= max_load_addr && - ((unw_word_t)dyn + sizeof(Elf_W(Dyn))) >= min_load_addr && dyn->d_tag != DT_NULL) { - if (dyn->d_tag == DT_PLTGOT) { - /* Assume that _DYNAMIC is writable and GLIBC has - relocated it (true for x86 at least). */ - edi->di_cache.gp = dyn->d_un.d_ptr; - } else if (dyn->d_tag == DT_SONAME) { - ei->lib_name_offset = dyn->d_un.d_val; + Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(pdyn->p_offset + + (char *) edi->ei.image); + for (; dyn->d_tag != DT_NULL; ++dyn) + if (dyn->d_tag == DT_PLTGOT) + { + /* Assume that _DYNAMIC is writable and GLIBC has + relocated it (true for x86 at least). */ + edi->di_cache.gp = dyn->d_un.d_ptr; + break; } - ++dyn; - } } else /* Otherwise this is a static executable with no _DYNAMIC. Assume @@ -224,17 +133,11 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, edi->di_cache.gp = 0; hdr = (struct dwarf_eh_frame_hdr *) (peh_hdr->p_offset - + (char *) ei->image); - if (((unw_word_t)hdr + sizeof(struct dwarf_eh_frame_hdr)) > max_load_addr || - ((unw_word_t)hdr + sizeof(struct dwarf_eh_frame_hdr)) < min_load_addr) { - return -UNW_ENOINFO; - } - + + (char *) edi->ei.image); if (hdr->version != DW_EH_VERSION) { - if (path != NULL) { - Debug (1, "table `%s' has unexpected version %d\n", path, hdr->version); - } + Debug (1, "table `%s' has unexpected version %d\n", + path, hdr->version); return -UNW_ENOINFO; } @@ -262,9 +165,9 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) { - #if 0 + #if 1 abort (); - + #else unw_word_t eh_frame_end; /* If there is no search table or it has an unsupported @@ -296,28 +199,27 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, /* two 32-bit values (ip_offset/fde_offset) per table-entry: */ edi->di_cache.u.rti.table_len = (fde_count * 8) / sizeof (unw_word_t); edi->di_cache.u.rti.table_data = ((load_base + peh_hdr->p_vaddr) - + (addr - (unw_word_t) ei->image + + (addr - to_unw_word (edi->ei.image) - peh_hdr->p_offset)); /* For the binary-search table in the eh_frame_hdr, data-relative means relative to the start of that section... */ - /* Add For Cache MAP And ELF */ edi->di_cache.u.rti.segbase = ((load_base + peh_hdr->p_vaddr) - + ((unw_word_t) hdr - (unw_word_t) ei->image - - peh_hdr->p_offset)); - /* Add For Cache MAP And ELF */ + + (to_unw_word (hdr) - + to_unw_word (edi->ei.image) + - peh_hdr->p_offset)); found = 1; } #if UNW_TARGET_ARM - if (param_exidx) + if (parm_exidx) { edi->di_arm.format = UNW_INFO_FORMAT_ARM_EXIDX; edi->di_arm.start_ip = start_ip; edi->di_arm.end_ip = end_ip; edi->di_arm.u.rti.name_ptr = to_unw_word (path); - edi->di_arm.u.rti.table_data = load_base + param_exidx->p_vaddr; - edi->di_arm.u.rti.table_len = param_exidx->p_memsz; + edi->di_arm.u.rti.table_data = load_base + parm_exidx->p_vaddr; + edi->di_arm.u.rti.table_len = parm_exidx->p_memsz; found = 1; } #endif @@ -327,11 +229,6 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, struct elf_image *ei, found = dwarf_find_debug_frame (found, &edi->di_debug, ip, load_base, path, start_ip, end_ip); #endif - if (found == 1) { - edi->start_ip = start_ip; - edi->end_ip = end_ip; - ei->elf_dyn_info = *edi; - ei->has_dyn_info = 1; - } + return found; } diff --git a/src/dwarf/Gparser.c b/libunwind/src/dwarf/Gparser.c similarity index 89% rename from src/dwarf/Gparser.c rename to libunwind/src/dwarf/Gparser.c index 901f136a..da170d4b 100644 --- a/src/dwarf/Gparser.c +++ b/libunwind/src/dwarf/Gparser.c @@ -87,13 +87,6 @@ empty_rstate_stack(dwarf_stackable_reg_state_t **rs_stack) pop_rstate_stack(rs_stack); } -#ifdef UNW_TARGET_AARCH64 - -static void -aarch64_negate_ra_sign_state(dwarf_state_record_t *sr); - -#endif - /* Run a CFI program to update the register state. */ static int run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, @@ -341,24 +334,6 @@ run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, (long) (val * dci->data_align)); break; - case DW_CFA_val_offset: - if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) - || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) - break; - set_reg (sr, regnum, DWARF_WHERE_VAL, val * dci->data_align); - Debug (15, "CFA_offset_extended_sf r%lu at cf+0x%lx\n", - (long) regnum, (long) (val * dci->data_align)); - break; - - case DW_CFA_val_offset_sf: - if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) - || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0)) - break; - set_reg (sr, regnum, DWARF_WHERE_VAL, val * dci->data_align); - Debug (15, "CFA_offset_extended_sf r%lu at cf+0x%lx\n", - (long) regnum, (long) (val * dci->data_align)); - break; - case DW_CFA_def_cfa_expression: /* Save the address of the DW_FORM_block for later evaluation. */ set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_EXPR, *addr); @@ -415,9 +390,9 @@ run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) break; - set_reg (sr, regnum, DWARF_WHERE_CFAREL, ~(val * dci->data_align) + 1); + set_reg (sr, regnum, DWARF_WHERE_CFAREL, -(val * dci->data_align)); Debug (15, "CFA_GNU_negative_offset_extended cfa+0x%lx\n", - (long) (~(val * dci->data_align) + 1)); + (long) -(val * dci->data_align)); break; case DW_CFA_GNU_window_save: @@ -429,11 +404,6 @@ run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, (regnum - 16) * sizeof (unw_word_t)); Debug (15, "CFA_GNU_window_save\n"); break; -#elif UNW_TARGET_AARCH64 - /* This is a specific opcode on aarch64, DW_CFA_AARCH64_negate_ra_state */ - Debug (15, "DW_CFA_AARCH64_negate_ra_state\n"); - aarch64_negate_ra_sign_state(sr); - break; #else /* FALL THROUGH */ #endif @@ -794,63 +764,6 @@ eval_location_expr (struct dwarf_cursor *c, unw_word_t stack_val, unw_addr_space return 0; } - -#ifdef UNW_TARGET_AARCH64 -#include "libunwind-aarch64.h" - -static void -aarch64_negate_ra_sign_state(dwarf_state_record_t *sr) -{ - unw_word_t ra_sign_state = sr->rs_current.reg.val[UNW_AARCH64_RA_SIGN_STATE]; - ra_sign_state ^= 0x1; - set_reg(sr, UNW_AARCH64_RA_SIGN_STATE, DWARF_WHERE_SAME, ra_sign_state); -} - -static unw_word_t -aarch64_strip_pac_remote(unw_accessors_t *a, unw_addr_space_t as, void *arg, unw_word_t old_ip) -{ - if (a->ptrauth_insn_mask) - { - unw_word_t ip, insn_mask; - - insn_mask = a->ptrauth_insn_mask(as, arg); - ip = old_ip & (~insn_mask); - - Debug(15, "stripping pac from address, before: %lx, after: %lx\n", old_ip, ip); - return ip; - } - else - { - unw_word_t insn_mask = 0xFFFFFF8000000000; // mask all bits from [63:40]; - unw_word_t ip = old_ip & (~insn_mask); - Debug(15, "return address %lx might be signed, use 0xFFFFFF8000000000 as default mask\n", old_ip); - return ip; - } -} - -static unw_word_t -aarch64_strip_pac_local(unw_word_t in_addr) -{ - unw_word_t out_addr = in_addr; - -#ifdef __aarch64__ - // Strip the PAC with XPACLRI instruction - register unsigned long long x30 __asm__("x30") = in_addr; - __asm__("hint 0x7" : "+r" (x30)); - out_addr = x30; -#endif - - return out_addr; -} - -static unw_word_t -aarch64_get_ra_sign_state(struct dwarf_reg_state *rs) -{ - return rs->reg.val[UNW_AARCH64_RA_SIGN_STATE]; -} - -#endif - static int apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs) { @@ -862,15 +775,6 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs) int i, ret; void *arg; - /* In the case that we have incorrect CFI, the return address column may be - * outside the valid range of data and will read invalid data. Protect - * against the errant read and indicate that we have a bad frame. */ - if (rs->ret_addr_column >= DWARF_NUM_PRESERVED_REGS) { - Dprintf ("%s: return address entry %zu is outside of range of CIE", - __FUNCTION__, rs->ret_addr_column); - return -UNW_EBADFRAME; - } - prev_ip = c->ip; prev_cfa = c->cfa; @@ -918,16 +822,10 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs) cfa = DWARF_GET_LOC (cfa_loc); } -#ifdef ONLY_RECOVER_GENERAL_REGS -const int32_t regCount = 33; -#else -const int32_t regCount = DWARF_NUM_PRESERVED_REGS; -#endif - dwarf_loc_t new_loc[DWARF_NUM_PRESERVED_REGS]; memcpy(new_loc, c->loc, sizeof(new_loc)); - for (i = 0; i < regCount; ++i) + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) { switch ((dwarf_where_t) rs->reg.where[i]) { @@ -970,12 +868,6 @@ const int32_t regCount = DWARF_NUM_PRESERVED_REGS; return ret; new_loc[i] = DWARF_VAL_LOC (c, DWARF_GET_LOC (new_loc[i])); break; - - case DWARF_WHERE_VAL: - new_loc[i] = DWARF_VAL_LOC (c, DWARF_GET_LOC (new_loc[i])); - Debug (16, "%s(%d), where[%d]=0x%x, new_loc.val=0x%x\n", - __FILE__, __LINE__, i, rs->reg.where[i], new_loc[i].val); - break; } } @@ -993,19 +885,6 @@ const int32_t regCount = DWARF_NUM_PRESERVED_REGS; ret = dwarf_get (c, c->loc[rs->ret_addr_column], &ip); if (ret < 0) return ret; -#ifdef UNW_TARGET_AARCH64 - if (aarch64_get_ra_sign_state(rs)) - { - if (c->as != NULL && c->as->pid == -1) - { - ip = aarch64_strip_pac_local(ip); - } - else - { - ip = aarch64_strip_pac_remote(a, as, arg, ip); - } - } -#endif c->ip = ip; ret = 1; } @@ -1028,7 +907,7 @@ const int32_t regCount = DWARF_NUM_PRESERVED_REGS; static int find_reg_state (struct dwarf_cursor *c, dwarf_state_record_t *sr) { - dwarf_reg_state_t *rs = NULL; + dwarf_reg_state_t *rs; struct dwarf_rs_cache *cache; int ret = 0; intrmask_t saved_mask; @@ -1074,11 +953,13 @@ find_reg_state (struct dwarf_cursor *c, dwarf_state_record_t *sr) cache->links[c->prev_rs].hint = index + 1; c->prev_rs = index; } - if (ret >= 0) - tdep_reuse_frame (c, cache->links[index].signal_frame); put_rs_cache (c->as, cache, &saved_mask); } - return ret; + if (ret < 0) + return ret; + if (cache) + tdep_reuse_frame (c, cache->links[index].signal_frame); + return 0; } /* The function finds the saved locations and applies the register @@ -1104,7 +985,6 @@ dwarf_make_proc_info (struct dwarf_cursor *c) args_size, and set cursor appropriately. Only needed for unw_resume */ dwarf_state_record_t sr; - sr.args_size = 0; int ret; /* Lookup it up the slow way... */ diff --git a/src/dwarf/Gpe.c b/libunwind/src/dwarf/Gpe.c similarity index 100% rename from src/dwarf/Gpe.c rename to libunwind/src/dwarf/Gpe.c diff --git a/src/dwarf/Lexpr.c b/libunwind/src/dwarf/Lexpr.c similarity index 100% rename from src/dwarf/Lexpr.c rename to libunwind/src/dwarf/Lexpr.c diff --git a/src/dwarf/Lfde.c b/libunwind/src/dwarf/Lfde.c similarity index 100% rename from src/dwarf/Lfde.c rename to libunwind/src/dwarf/Lfde.c diff --git a/src/dwarf/Lfind_proc_info-lsb.c b/libunwind/src/dwarf/Lfind_proc_info-lsb.c similarity index 100% rename from src/dwarf/Lfind_proc_info-lsb.c rename to libunwind/src/dwarf/Lfind_proc_info-lsb.c diff --git a/src/dwarf/Lfind_unwind_table.c b/libunwind/src/dwarf/Lfind_unwind_table.c similarity index 100% rename from src/dwarf/Lfind_unwind_table.c rename to libunwind/src/dwarf/Lfind_unwind_table.c diff --git a/src/dwarf/Lparser.c b/libunwind/src/dwarf/Lparser.c similarity index 100% rename from src/dwarf/Lparser.c rename to libunwind/src/dwarf/Lparser.c diff --git a/src/dwarf/Lpe.c b/libunwind/src/dwarf/Lpe.c similarity index 100% rename from src/dwarf/Lpe.c rename to libunwind/src/dwarf/Lpe.c diff --git a/src/dwarf/global.c b/libunwind/src/dwarf/global.c similarity index 100% rename from src/dwarf/global.c rename to libunwind/src/dwarf/global.c diff --git a/src/elf32.c b/libunwind/src/elf32.c similarity index 100% rename from src/elf32.c rename to libunwind/src/elf32.c diff --git a/src/elf32.h b/libunwind/src/elf32.h similarity index 100% rename from src/elf32.h rename to libunwind/src/elf32.h diff --git a/src/elf64.c b/libunwind/src/elf64.c similarity index 100% rename from src/elf64.c rename to libunwind/src/elf64.c diff --git a/src/elf64.h b/libunwind/src/elf64.h similarity index 100% rename from src/elf64.h rename to libunwind/src/elf64.h diff --git a/src/elfxx.c b/libunwind/src/elfxx.c similarity index 75% rename from src/elfxx.c rename to libunwind/src/elfxx.c index 8e17f3b5..321cfb97 100644 --- a/src/elfxx.c +++ b/libunwind/src/elfxx.c @@ -157,82 +157,6 @@ elf_w (lookup_symbol) (unw_addr_space_t as, return ret; } -static int -elf_w (find_symbol_info_in_image) (struct elf_image *ei, - unw_word_t load_offset, - uint64_t pc, - int buf_sz, - char *buf, - uint64_t *sym_start, - uint64_t *sym_end) -{ - size_t syment_size; - Elf_W (Ehdr) *ehdr = ei->image; - Elf_W (Sym) *sym, *symtab, *symtab_end; - Elf_W (Shdr) *shdr; - Elf_W (Addr) val; - int i, ret = -UNW_ENOINFO; - char *strtab; - uint64_t start = 0; - uint64_t end = 0; - - if (!elf_w (valid_object) (ei)) - return -UNW_ENOINFO; - - shdr = elf_w (section_table) (ei); - if (!shdr) - return -UNW_ENOINFO; - - for (i = 0; i < ehdr->e_shnum; ++i) - { - switch (shdr->sh_type) - { - case SHT_SYMTAB: - case SHT_DYNSYM: - symtab = (Elf_W (Sym) *) ((char *) ei->image + shdr->sh_offset); - symtab_end = (Elf_W (Sym) *) ((char *) symtab + shdr->sh_size); - syment_size = shdr->sh_entsize; - strtab = elf_w (string_table) (ei, shdr->sh_link); - if (!strtab) { - Dprintf( "no strtab?\n"); - break; - } - - if (!ei->strtab) { - ei->strtab = strtab; - } - - for (sym = symtab; - sym < symtab_end; - sym = (Elf_W (Sym) *) ((char *) sym + syment_size)) - { - if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC - && sym->st_shndx != SHN_UNDEF) - { - val = sym->st_value; - if (sym->st_shndx != SHN_ABS) - val += load_offset; - start = (uint64_t)val; - end = start + (uint64_t)sym->st_size; - if (pc >= start && pc < end) { - strncpy (buf, strtab + sym->st_name, buf_sz); - buf[buf_sz - 1] = '\0'; - *sym_start = start; - *sym_end = end; - return 0; - } - } - } - break; - - default: - break; - } - shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize); - } - return ret; -} - static Elf_W (Addr) elf_w (get_load_offset) (struct elf_image *ei, unsigned long segbase, unsigned long mapoff) @@ -300,7 +224,7 @@ elf_w (extract_minidebuginfo) (struct elf_image *ei, struct elf_image *mdi) uint8_t *compressed = NULL; uint64_t memlimit = UINT64_MAX; /* no memory limit */ size_t compressed_len, uncompressed_len; - mdi->has_try_load = 1; + shdr = elf_w (find_section) (ei, ".gnu_debugdata"); if (!shdr) return 0; @@ -311,7 +235,7 @@ elf_w (extract_minidebuginfo) (struct elf_image *ei, struct elf_image *mdi) uncompressed_len = xz_uncompressed_size (compressed, compressed_len); if (uncompressed_len == 0) { - Dprintf("invalid .gnu_debugdata contents\n"); + Debug (1, "invalid .gnu_debugdata contents\n"); return 0; } @@ -329,9 +253,8 @@ elf_w (extract_minidebuginfo) (struct elf_image *ei, struct elf_image *mdi) mdi->image, &out_pos, mdi->size); if (lret != LZMA_OK) { - Dprintf( "LZMA decompression failed: %d\n", lret); + Debug (1, "LZMA decompression failed: %d\n", lret); munmap (mdi->image, mdi->size); - mdi->image = NULL; return 0; } @@ -361,7 +284,7 @@ elf_w (get_proc_name_in_image) (unw_addr_space_t as, struct elf_image *ei, Elf_W (Addr) min_dist = ~(Elf_W (Addr))0; int ret; - load_offset = segbase - ei->load_offset; + load_offset = elf_w (get_load_offset) (ei, segbase, mapoff); ret = elf_w (lookup_symbol) (as, ip, ei, load_offset, buf, buf_len, &min_dist); /* If the ELF image has MiniDebugInfo embedded in it, look up the symbol in @@ -388,22 +311,31 @@ elf_w (get_proc_name_in_image) (unw_addr_space_t as, struct elf_image *ei, return ret; } -/* Add For Cache MAP And ELF */ HIDDEN int elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp) { + unsigned long segbase, mapoff; + struct elf_image ei; int ret; - struct map_info *map = tdep_get_elf_image (as, pid, ip); + char file[PATH_MAX]; - if (map == NULL) - return -UNW_ENOINFO; + ret = tdep_get_elf_image (&ei, pid, ip, &segbase, &mapoff, file, PATH_MAX); + if (ret < 0) + return ret; - ret = elf_w (get_proc_name_in_image) (as, &map->ei, map->start, map->offset, ip, buf, buf_len, offp); + ret = elf_w (load_debuglink) (file, &ei, 1); + if (ret < 0) + return ret; + + ret = elf_w (get_proc_name_in_image) (as, &ei, segbase, mapoff, ip, buf, buf_len, offp); + + munmap (ei.image, ei.size); + ei.image = NULL; return ret; } -/* Add For Cache MAP And ELF */ + HIDDEN Elf_W (Shdr)* elf_w (find_section) (struct elf_image *ei, const char* secname) { @@ -467,7 +399,7 @@ elf_w (load_debuglink) (const char* file, struct elf_image *ei, int is_local) { ret = elf_map_image(ei, file); if (ret) - return ret; + return ret; } prev_image = ei->image; @@ -553,52 +485,3 @@ elf_w (load_debuglink) (const char* file, struct elf_image *ei, int is_local) return 0; } - -int elf_w (get_symbol_info_in_image) (struct elf_image *ei, - unsigned long segbase, - unsigned long mapoff, - uint64_t pc, - int buf_sz, - char *buf, - uint64_t *sym_start, - uint64_t *sym_end) -{ - Elf_W (Addr) load_offset = elf_w (get_load_offset) (ei, segbase, mapoff); - int ret = elf_w (find_symbol_info_in_image) (ei, load_offset, pc, buf_sz, buf, sym_start, sym_end); - if (ret == 0) { - return ret; - } - - if (ei->mdi == NULL) { - return ret; - } - - if (ei->mdi->image == NULL && ei->mdi->has_try_load) { - return ret; - } - - if (ei->mdi->image != NULL || elf_w (extract_minidebuginfo) (ei, ei->mdi)) { - ret = elf_w (find_symbol_info_in_image) (ei->mdi, load_offset, pc, buf_sz, buf, sym_start, sym_end); - } - return ret; -} - -size_t calc_elf_file_size (void* elf, size_t map_sz) -{ - if (map_sz < sizeof(Elf_W (Ehdr))) { - Dprintf("invalid elf size? sz:%d, request sz:%d\n", (int)map_sz, (int)sizeof(Elf_W (Ehdr))); - return 0; - } - - // validate the magic number and version of elf - if (!(memcmp (elf, ELFMAG, SELFMAG) == 0 - && ((uint8_t *) elf)[EI_CLASS] == UNW_ELF_CLASS - && ((uint8_t *) elf)[EI_VERSION] != EV_NONE - && ((uint8_t *) elf)[EI_VERSION] <= EV_CURRENT)) { - Dprintf("invalid elf hdr?\n"); - return 0; - } - - Elf_W (Ehdr) *ehdr = elf; - return (ehdr->e_shoff + (ehdr->e_shentsize * ehdr->e_shnum)); -} \ No newline at end of file diff --git a/src/elfxx.h b/libunwind/src/elfxx.h similarity index 83% rename from src/elfxx.h rename to libunwind/src/elfxx.h index b64dce4d..fe5fcbcd 100644 --- a/src/elfxx.h +++ b/libunwind/src/elfxx.h @@ -24,8 +24,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef ELFXX_H -#define ELFXX_H #include #include @@ -56,15 +54,6 @@ extern int elf_w (get_proc_name_in_image) (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp); -extern int elf_w (get_symbol_info_in_image) (struct elf_image *ei, - unsigned long segbase, - unsigned long mapoff, - uint64_t pc, - int buf_sz, - char *buf, - uint64_t *sym_start, - uint64_t *sym_end); - extern Elf_W (Shdr)* elf_w (find_section) (struct elf_image *ei, const char* secname); extern int elf_w (load_debuglink) (const char* file, struct elf_image *ei, int is_local); @@ -80,15 +69,13 @@ elf_w (valid_object) (struct elf_image *ei) && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT); } -extern size_t calc_elf_file_size (void* elf, size_t map_sz); - static inline int elf_map_image (struct elf_image *ei, const char *path) { struct stat stat; int fd; - fd = UNW_TEMP_FAILURE_RETRY (open (path, O_RDONLY)); + fd = open (path, O_RDONLY); if (fd < 0) return -1; @@ -112,5 +99,3 @@ elf_map_image (struct elf_image *ei, const char *path) return 0; } - -#endif diff --git a/src/hppa/Gapply_reg_state.c b/libunwind/src/hppa/Gapply_reg_state.c similarity index 100% rename from src/hppa/Gapply_reg_state.c rename to libunwind/src/hppa/Gapply_reg_state.c diff --git a/src/hppa/Gcreate_addr_space.c b/libunwind/src/hppa/Gcreate_addr_space.c similarity index 100% rename from src/hppa/Gcreate_addr_space.c rename to libunwind/src/hppa/Gcreate_addr_space.c diff --git a/src/hppa/Gget_proc_info.c b/libunwind/src/hppa/Gget_proc_info.c similarity index 100% rename from src/hppa/Gget_proc_info.c rename to libunwind/src/hppa/Gget_proc_info.c diff --git a/src/hppa/Gget_save_loc.c b/libunwind/src/hppa/Gget_save_loc.c similarity index 100% rename from src/hppa/Gget_save_loc.c rename to libunwind/src/hppa/Gget_save_loc.c diff --git a/src/hppa/Gglobal.c b/libunwind/src/hppa/Gglobal.c similarity index 100% rename from src/hppa/Gglobal.c rename to libunwind/src/hppa/Gglobal.c diff --git a/src/hppa/Ginit.c b/libunwind/src/hppa/Ginit.c similarity index 100% rename from src/hppa/Ginit.c rename to libunwind/src/hppa/Ginit.c diff --git a/src/hppa/Ginit_local.c b/libunwind/src/hppa/Ginit_local.c similarity index 100% rename from src/hppa/Ginit_local.c rename to libunwind/src/hppa/Ginit_local.c diff --git a/src/hppa/Ginit_remote.c b/libunwind/src/hppa/Ginit_remote.c similarity index 100% rename from src/hppa/Ginit_remote.c rename to libunwind/src/hppa/Ginit_remote.c diff --git a/src/hppa/Gis_signal_frame.c b/libunwind/src/hppa/Gis_signal_frame.c similarity index 100% rename from src/hppa/Gis_signal_frame.c rename to libunwind/src/hppa/Gis_signal_frame.c diff --git a/src/hppa/Greg_states_iterate.c b/libunwind/src/hppa/Greg_states_iterate.c similarity index 100% rename from src/hppa/Greg_states_iterate.c rename to libunwind/src/hppa/Greg_states_iterate.c diff --git a/src/hppa/Gregs.c b/libunwind/src/hppa/Gregs.c similarity index 100% rename from src/hppa/Gregs.c rename to libunwind/src/hppa/Gregs.c diff --git a/src/hppa/Gresume.c b/libunwind/src/hppa/Gresume.c similarity index 100% rename from src/hppa/Gresume.c rename to libunwind/src/hppa/Gresume.c diff --git a/src/hppa/Gstep.c b/libunwind/src/hppa/Gstep.c similarity index 100% rename from src/hppa/Gstep.c rename to libunwind/src/hppa/Gstep.c diff --git a/src/hppa/Lapply_reg_state.c b/libunwind/src/hppa/Lapply_reg_state.c similarity index 100% rename from src/hppa/Lapply_reg_state.c rename to libunwind/src/hppa/Lapply_reg_state.c diff --git a/src/hppa/Lcreate_addr_space.c b/libunwind/src/hppa/Lcreate_addr_space.c similarity index 100% rename from src/hppa/Lcreate_addr_space.c rename to libunwind/src/hppa/Lcreate_addr_space.c diff --git a/src/hppa/Lget_proc_info.c b/libunwind/src/hppa/Lget_proc_info.c similarity index 100% rename from src/hppa/Lget_proc_info.c rename to libunwind/src/hppa/Lget_proc_info.c diff --git a/src/hppa/Lget_save_loc.c b/libunwind/src/hppa/Lget_save_loc.c similarity index 100% rename from src/hppa/Lget_save_loc.c rename to libunwind/src/hppa/Lget_save_loc.c diff --git a/src/hppa/Lglobal.c b/libunwind/src/hppa/Lglobal.c similarity index 100% rename from src/hppa/Lglobal.c rename to libunwind/src/hppa/Lglobal.c diff --git a/src/hppa/Linit.c b/libunwind/src/hppa/Linit.c similarity index 100% rename from src/hppa/Linit.c rename to libunwind/src/hppa/Linit.c diff --git a/src/hppa/Linit_local.c b/libunwind/src/hppa/Linit_local.c similarity index 100% rename from src/hppa/Linit_local.c rename to libunwind/src/hppa/Linit_local.c diff --git a/src/hppa/Linit_remote.c b/libunwind/src/hppa/Linit_remote.c similarity index 100% rename from src/hppa/Linit_remote.c rename to libunwind/src/hppa/Linit_remote.c diff --git a/src/arm/Lis_signal_frame.c b/libunwind/src/hppa/Lis_signal_frame.c similarity index 100% rename from src/arm/Lis_signal_frame.c rename to libunwind/src/hppa/Lis_signal_frame.c diff --git a/src/hppa/Lreg_states_iterate.c b/libunwind/src/hppa/Lreg_states_iterate.c similarity index 100% rename from src/hppa/Lreg_states_iterate.c rename to libunwind/src/hppa/Lreg_states_iterate.c diff --git a/src/hppa/Lregs.c b/libunwind/src/hppa/Lregs.c similarity index 100% rename from src/hppa/Lregs.c rename to libunwind/src/hppa/Lregs.c diff --git a/src/hppa/Lresume.c b/libunwind/src/hppa/Lresume.c similarity index 100% rename from src/hppa/Lresume.c rename to libunwind/src/hppa/Lresume.c diff --git a/src/hppa/Lstep.c b/libunwind/src/hppa/Lstep.c similarity index 100% rename from src/hppa/Lstep.c rename to libunwind/src/hppa/Lstep.c diff --git a/src/hppa/getcontext.S b/libunwind/src/hppa/getcontext.S similarity index 100% rename from src/hppa/getcontext.S rename to libunwind/src/hppa/getcontext.S diff --git a/src/hppa/init.h b/libunwind/src/hppa/init.h similarity index 100% rename from src/hppa/init.h rename to libunwind/src/hppa/init.h diff --git a/src/hppa/offsets.h b/libunwind/src/hppa/offsets.h similarity index 100% rename from src/hppa/offsets.h rename to libunwind/src/hppa/offsets.h diff --git a/src/hppa/regname.c b/libunwind/src/hppa/regname.c similarity index 100% rename from src/hppa/regname.c rename to libunwind/src/hppa/regname.c diff --git a/src/hppa/setcontext.S b/libunwind/src/hppa/setcontext.S similarity index 100% rename from src/hppa/setcontext.S rename to libunwind/src/hppa/setcontext.S diff --git a/src/hppa/siglongjmp.S b/libunwind/src/hppa/siglongjmp.S similarity index 100% rename from src/hppa/siglongjmp.S rename to libunwind/src/hppa/siglongjmp.S diff --git a/src/hppa/unwind_i.h b/libunwind/src/hppa/unwind_i.h similarity index 100% rename from src/hppa/unwind_i.h rename to libunwind/src/hppa/unwind_i.h diff --git a/src/ia64/Gapply_reg_state.c b/libunwind/src/ia64/Gapply_reg_state.c similarity index 100% rename from src/ia64/Gapply_reg_state.c rename to libunwind/src/ia64/Gapply_reg_state.c diff --git a/src/ia64/Gcreate_addr_space.c b/libunwind/src/ia64/Gcreate_addr_space.c similarity index 100% rename from src/ia64/Gcreate_addr_space.c rename to libunwind/src/ia64/Gcreate_addr_space.c diff --git a/src/ia64/Gfind_unwind_table.c b/libunwind/src/ia64/Gfind_unwind_table.c similarity index 100% rename from src/ia64/Gfind_unwind_table.c rename to libunwind/src/ia64/Gfind_unwind_table.c diff --git a/src/ia64/Gget_proc_info.c b/libunwind/src/ia64/Gget_proc_info.c similarity index 100% rename from src/ia64/Gget_proc_info.c rename to libunwind/src/ia64/Gget_proc_info.c diff --git a/src/ia64/Gget_save_loc.c b/libunwind/src/ia64/Gget_save_loc.c similarity index 100% rename from src/ia64/Gget_save_loc.c rename to libunwind/src/ia64/Gget_save_loc.c diff --git a/src/ia64/Gglobal.c b/libunwind/src/ia64/Gglobal.c similarity index 100% rename from src/ia64/Gglobal.c rename to libunwind/src/ia64/Gglobal.c diff --git a/src/ia64/Ginit.c b/libunwind/src/ia64/Ginit.c similarity index 100% rename from src/ia64/Ginit.c rename to libunwind/src/ia64/Ginit.c diff --git a/src/ia64/Ginit_local.c b/libunwind/src/ia64/Ginit_local.c similarity index 100% rename from src/ia64/Ginit_local.c rename to libunwind/src/ia64/Ginit_local.c diff --git a/src/ia64/Ginit_remote.c b/libunwind/src/ia64/Ginit_remote.c similarity index 100% rename from src/ia64/Ginit_remote.c rename to libunwind/src/ia64/Ginit_remote.c diff --git a/src/ia64/Ginstall_cursor.S b/libunwind/src/ia64/Ginstall_cursor.S similarity index 100% rename from src/ia64/Ginstall_cursor.S rename to libunwind/src/ia64/Ginstall_cursor.S diff --git a/src/ia64/Gis_signal_frame.c b/libunwind/src/ia64/Gis_signal_frame.c similarity index 100% rename from src/ia64/Gis_signal_frame.c rename to libunwind/src/ia64/Gis_signal_frame.c diff --git a/src/ia64/Gparser.c b/libunwind/src/ia64/Gparser.c similarity index 100% rename from src/ia64/Gparser.c rename to libunwind/src/ia64/Gparser.c diff --git a/src/ia64/Grbs.c b/libunwind/src/ia64/Grbs.c similarity index 100% rename from src/ia64/Grbs.c rename to libunwind/src/ia64/Grbs.c diff --git a/src/ia64/Greg_states_iterate.c b/libunwind/src/ia64/Greg_states_iterate.c similarity index 100% rename from src/ia64/Greg_states_iterate.c rename to libunwind/src/ia64/Greg_states_iterate.c diff --git a/src/ia64/Gregs.c b/libunwind/src/ia64/Gregs.c similarity index 100% rename from src/ia64/Gregs.c rename to libunwind/src/ia64/Gregs.c diff --git a/src/ia64/Gresume.c b/libunwind/src/ia64/Gresume.c similarity index 100% rename from src/ia64/Gresume.c rename to libunwind/src/ia64/Gresume.c diff --git a/src/ia64/Gscript.c b/libunwind/src/ia64/Gscript.c similarity index 100% rename from src/ia64/Gscript.c rename to libunwind/src/ia64/Gscript.c diff --git a/src/ia64/Gstep.c b/libunwind/src/ia64/Gstep.c similarity index 100% rename from src/ia64/Gstep.c rename to libunwind/src/ia64/Gstep.c diff --git a/src/ia64/Gtables.c b/libunwind/src/ia64/Gtables.c similarity index 100% rename from src/ia64/Gtables.c rename to libunwind/src/ia64/Gtables.c diff --git a/src/ia64/Lapply_reg_state.c b/libunwind/src/ia64/Lapply_reg_state.c similarity index 100% rename from src/ia64/Lapply_reg_state.c rename to libunwind/src/ia64/Lapply_reg_state.c diff --git a/src/ia64/Lcreate_addr_space.c b/libunwind/src/ia64/Lcreate_addr_space.c similarity index 100% rename from src/ia64/Lcreate_addr_space.c rename to libunwind/src/ia64/Lcreate_addr_space.c diff --git a/src/ia64/Lfind_unwind_table.c b/libunwind/src/ia64/Lfind_unwind_table.c similarity index 100% rename from src/ia64/Lfind_unwind_table.c rename to libunwind/src/ia64/Lfind_unwind_table.c diff --git a/src/ia64/Lget_proc_info.c b/libunwind/src/ia64/Lget_proc_info.c similarity index 100% rename from src/ia64/Lget_proc_info.c rename to libunwind/src/ia64/Lget_proc_info.c diff --git a/src/ia64/Lget_save_loc.c b/libunwind/src/ia64/Lget_save_loc.c similarity index 100% rename from src/ia64/Lget_save_loc.c rename to libunwind/src/ia64/Lget_save_loc.c diff --git a/src/ia64/Lglobal.c b/libunwind/src/ia64/Lglobal.c similarity index 100% rename from src/ia64/Lglobal.c rename to libunwind/src/ia64/Lglobal.c diff --git a/src/ia64/Linit.c b/libunwind/src/ia64/Linit.c similarity index 100% rename from src/ia64/Linit.c rename to libunwind/src/ia64/Linit.c diff --git a/src/ia64/Linit_local.c b/libunwind/src/ia64/Linit_local.c similarity index 100% rename from src/ia64/Linit_local.c rename to libunwind/src/ia64/Linit_local.c diff --git a/src/ia64/Linit_remote.c b/libunwind/src/ia64/Linit_remote.c similarity index 100% rename from src/ia64/Linit_remote.c rename to libunwind/src/ia64/Linit_remote.c diff --git a/src/ia64/Linstall_cursor.S b/libunwind/src/ia64/Linstall_cursor.S similarity index 100% rename from src/ia64/Linstall_cursor.S rename to libunwind/src/ia64/Linstall_cursor.S diff --git a/src/hppa/Lis_signal_frame.c b/libunwind/src/ia64/Lis_signal_frame.c similarity index 100% rename from src/hppa/Lis_signal_frame.c rename to libunwind/src/ia64/Lis_signal_frame.c diff --git a/src/ia64/Lparser.c b/libunwind/src/ia64/Lparser.c similarity index 100% rename from src/ia64/Lparser.c rename to libunwind/src/ia64/Lparser.c diff --git a/src/ia64/Lrbs.c b/libunwind/src/ia64/Lrbs.c similarity index 100% rename from src/ia64/Lrbs.c rename to libunwind/src/ia64/Lrbs.c diff --git a/src/ia64/Lreg_states_iterate.c b/libunwind/src/ia64/Lreg_states_iterate.c similarity index 100% rename from src/ia64/Lreg_states_iterate.c rename to libunwind/src/ia64/Lreg_states_iterate.c diff --git a/src/ia64/Lregs.c b/libunwind/src/ia64/Lregs.c similarity index 100% rename from src/ia64/Lregs.c rename to libunwind/src/ia64/Lregs.c diff --git a/src/ia64/Lresume.c b/libunwind/src/ia64/Lresume.c similarity index 100% rename from src/ia64/Lresume.c rename to libunwind/src/ia64/Lresume.c diff --git a/src/ia64/Lscript.c b/libunwind/src/ia64/Lscript.c similarity index 100% rename from src/ia64/Lscript.c rename to libunwind/src/ia64/Lscript.c diff --git a/src/ia64/Lstep.c b/libunwind/src/ia64/Lstep.c similarity index 100% rename from src/ia64/Lstep.c rename to libunwind/src/ia64/Lstep.c diff --git a/src/ia64/Ltables.c b/libunwind/src/ia64/Ltables.c similarity index 100% rename from src/ia64/Ltables.c rename to libunwind/src/ia64/Ltables.c diff --git a/src/ia64/dyn_info_list.S b/libunwind/src/ia64/dyn_info_list.S similarity index 100% rename from src/ia64/dyn_info_list.S rename to libunwind/src/ia64/dyn_info_list.S diff --git a/src/ia64/getcontext.S b/libunwind/src/ia64/getcontext.S similarity index 100% rename from src/ia64/getcontext.S rename to libunwind/src/ia64/getcontext.S diff --git a/src/ia64/init.h b/libunwind/src/ia64/init.h similarity index 100% rename from src/ia64/init.h rename to libunwind/src/ia64/init.h diff --git a/src/ia64/longjmp.S b/libunwind/src/ia64/longjmp.S similarity index 100% rename from src/ia64/longjmp.S rename to libunwind/src/ia64/longjmp.S diff --git a/src/ia64/mk_Gcursor_i.c b/libunwind/src/ia64/mk_Gcursor_i.c similarity index 100% rename from src/ia64/mk_Gcursor_i.c rename to libunwind/src/ia64/mk_Gcursor_i.c diff --git a/src/ia64/mk_Lcursor_i.c b/libunwind/src/ia64/mk_Lcursor_i.c similarity index 100% rename from src/ia64/mk_Lcursor_i.c rename to libunwind/src/ia64/mk_Lcursor_i.c diff --git a/src/ia64/mk_cursor_i b/libunwind/src/ia64/mk_cursor_i similarity index 100% rename from src/ia64/mk_cursor_i rename to libunwind/src/ia64/mk_cursor_i diff --git a/src/ia64/offsets.h b/libunwind/src/ia64/offsets.h similarity index 100% rename from src/ia64/offsets.h rename to libunwind/src/ia64/offsets.h diff --git a/src/ia64/regname.c b/libunwind/src/ia64/regname.c similarity index 100% rename from src/ia64/regname.c rename to libunwind/src/ia64/regname.c diff --git a/src/ia64/regs.h b/libunwind/src/ia64/regs.h similarity index 100% rename from src/ia64/regs.h rename to libunwind/src/ia64/regs.h diff --git a/src/ia64/setjmp.S b/libunwind/src/ia64/setjmp.S similarity index 100% rename from src/ia64/setjmp.S rename to libunwind/src/ia64/setjmp.S diff --git a/src/ia64/siglongjmp.S b/libunwind/src/ia64/siglongjmp.S similarity index 100% rename from src/ia64/siglongjmp.S rename to libunwind/src/ia64/siglongjmp.S diff --git a/src/ia64/sigsetjmp.S b/libunwind/src/ia64/sigsetjmp.S similarity index 100% rename from src/ia64/sigsetjmp.S rename to libunwind/src/ia64/sigsetjmp.S diff --git a/src/ia64/ucontext_i.h b/libunwind/src/ia64/ucontext_i.h similarity index 100% rename from src/ia64/ucontext_i.h rename to libunwind/src/ia64/ucontext_i.h diff --git a/src/ia64/unwind_decoder.h b/libunwind/src/ia64/unwind_decoder.h similarity index 100% rename from src/ia64/unwind_decoder.h rename to libunwind/src/ia64/unwind_decoder.h diff --git a/src/ia64/unwind_i.h b/libunwind/src/ia64/unwind_i.h similarity index 100% rename from src/ia64/unwind_i.h rename to libunwind/src/ia64/unwind_i.h diff --git a/src/libunwind-generic.pc.in b/libunwind/src/libunwind-generic.pc.in similarity index 100% rename from src/libunwind-generic.pc.in rename to libunwind/src/libunwind-generic.pc.in diff --git a/src/mi/Gdestroy_addr_space.c b/libunwind/src/mi/Gdestroy_addr_space.c similarity index 91% rename from src/mi/Gdestroy_addr_space.c rename to libunwind/src/mi/Gdestroy_addr_space.c index a1450500..504558e1 100644 --- a/src/mi/Gdestroy_addr_space.c +++ b/libunwind/src/mi/Gdestroy_addr_space.c @@ -32,10 +32,6 @@ unw_destroy_addr_space (unw_addr_space_t as) # if UNW_DEBUG memset (as, 0, sizeof (*as)); # endif - /* Add For Cache MAP And ELF */ - if (as->map_list) - maps_destroy_list(as->map_list); - /* Add For Cache MAP And ELF */ free (as); #endif } diff --git a/src/mi/Gdyn-extract.c b/libunwind/src/mi/Gdyn-extract.c similarity index 100% rename from src/mi/Gdyn-extract.c rename to libunwind/src/mi/Gdyn-extract.c diff --git a/src/mi/Gdyn-remote.c b/libunwind/src/mi/Gdyn-remote.c similarity index 100% rename from src/mi/Gdyn-remote.c rename to libunwind/src/mi/Gdyn-remote.c diff --git a/src/mi/Gfind_dynamic_proc_info.c b/libunwind/src/mi/Gfind_dynamic_proc_info.c similarity index 100% rename from src/mi/Gfind_dynamic_proc_info.c rename to libunwind/src/mi/Gfind_dynamic_proc_info.c diff --git a/src/mi/Gget_accessors.c b/libunwind/src/mi/Gget_accessors.c similarity index 100% rename from src/mi/Gget_accessors.c rename to libunwind/src/mi/Gget_accessors.c diff --git a/src/mi/Gget_fpreg.c b/libunwind/src/mi/Gget_fpreg.c similarity index 100% rename from src/mi/Gget_fpreg.c rename to libunwind/src/mi/Gget_fpreg.c diff --git a/src/mi/Gget_proc_info_by_ip.c b/libunwind/src/mi/Gget_proc_info_by_ip.c similarity index 100% rename from src/mi/Gget_proc_info_by_ip.c rename to libunwind/src/mi/Gget_proc_info_by_ip.c diff --git a/src/mi/Gget_proc_name.c b/libunwind/src/mi/Gget_proc_name.c similarity index 100% rename from src/mi/Gget_proc_name.c rename to libunwind/src/mi/Gget_proc_name.c diff --git a/src/mi/Gget_reg.c b/libunwind/src/mi/Gget_reg.c similarity index 100% rename from src/mi/Gget_reg.c rename to libunwind/src/mi/Gget_reg.c diff --git a/src/mi/Gput_dynamic_unwind_info.c b/libunwind/src/mi/Gput_dynamic_unwind_info.c similarity index 100% rename from src/mi/Gput_dynamic_unwind_info.c rename to libunwind/src/mi/Gput_dynamic_unwind_info.c diff --git a/src/mi/Gset_cache_size.c b/libunwind/src/mi/Gset_cache_size.c similarity index 100% rename from src/mi/Gset_cache_size.c rename to libunwind/src/mi/Gset_cache_size.c diff --git a/src/mi/Gset_caching_policy.c b/libunwind/src/mi/Gset_caching_policy.c similarity index 100% rename from src/mi/Gset_caching_policy.c rename to libunwind/src/mi/Gset_caching_policy.c diff --git a/src/mi/Gset_fpreg.c b/libunwind/src/mi/Gset_fpreg.c similarity index 100% rename from src/mi/Gset_fpreg.c rename to libunwind/src/mi/Gset_fpreg.c diff --git a/src/mi/Gset_reg.c b/libunwind/src/mi/Gset_reg.c similarity index 100% rename from src/mi/Gset_reg.c rename to libunwind/src/mi/Gset_reg.c diff --git a/src/mi/Ldestroy_addr_space.c b/libunwind/src/mi/Ldestroy_addr_space.c similarity index 100% rename from src/mi/Ldestroy_addr_space.c rename to libunwind/src/mi/Ldestroy_addr_space.c diff --git a/src/mi/Ldyn-extract.c b/libunwind/src/mi/Ldyn-extract.c similarity index 100% rename from src/mi/Ldyn-extract.c rename to libunwind/src/mi/Ldyn-extract.c diff --git a/src/mi/Lfind_dynamic_proc_info.c b/libunwind/src/mi/Lfind_dynamic_proc_info.c similarity index 100% rename from src/mi/Lfind_dynamic_proc_info.c rename to libunwind/src/mi/Lfind_dynamic_proc_info.c diff --git a/src/mi/Lget_accessors.c b/libunwind/src/mi/Lget_accessors.c similarity index 100% rename from src/mi/Lget_accessors.c rename to libunwind/src/mi/Lget_accessors.c diff --git a/src/mi/Lget_fpreg.c b/libunwind/src/mi/Lget_fpreg.c similarity index 100% rename from src/mi/Lget_fpreg.c rename to libunwind/src/mi/Lget_fpreg.c diff --git a/src/mi/Lget_proc_info_by_ip.c b/libunwind/src/mi/Lget_proc_info_by_ip.c similarity index 100% rename from src/mi/Lget_proc_info_by_ip.c rename to libunwind/src/mi/Lget_proc_info_by_ip.c diff --git a/src/mi/Lget_proc_name.c b/libunwind/src/mi/Lget_proc_name.c similarity index 100% rename from src/mi/Lget_proc_name.c rename to libunwind/src/mi/Lget_proc_name.c diff --git a/src/mi/Lget_reg.c b/libunwind/src/mi/Lget_reg.c similarity index 100% rename from src/mi/Lget_reg.c rename to libunwind/src/mi/Lget_reg.c diff --git a/src/mi/Lput_dynamic_unwind_info.c b/libunwind/src/mi/Lput_dynamic_unwind_info.c similarity index 100% rename from src/mi/Lput_dynamic_unwind_info.c rename to libunwind/src/mi/Lput_dynamic_unwind_info.c diff --git a/src/mi/Lset_cache_size.c b/libunwind/src/mi/Lset_cache_size.c similarity index 100% rename from src/mi/Lset_cache_size.c rename to libunwind/src/mi/Lset_cache_size.c diff --git a/src/mi/Lset_caching_policy.c b/libunwind/src/mi/Lset_caching_policy.c similarity index 100% rename from src/mi/Lset_caching_policy.c rename to libunwind/src/mi/Lset_caching_policy.c diff --git a/src/mi/Lset_fpreg.c b/libunwind/src/mi/Lset_fpreg.c similarity index 100% rename from src/mi/Lset_fpreg.c rename to libunwind/src/mi/Lset_fpreg.c diff --git a/src/mi/Lset_reg.c b/libunwind/src/mi/Lset_reg.c similarity index 100% rename from src/mi/Lset_reg.c rename to libunwind/src/mi/Lset_reg.c diff --git a/src/mi/_ReadSLEB.c b/libunwind/src/mi/_ReadSLEB.c similarity index 100% rename from src/mi/_ReadSLEB.c rename to libunwind/src/mi/_ReadSLEB.c diff --git a/src/mi/_ReadULEB.c b/libunwind/src/mi/_ReadULEB.c similarity index 100% rename from src/mi/_ReadULEB.c rename to libunwind/src/mi/_ReadULEB.c diff --git a/src/mi/backtrace.c b/libunwind/src/mi/backtrace.c similarity index 100% rename from src/mi/backtrace.c rename to libunwind/src/mi/backtrace.c diff --git a/src/mi/dyn-cancel.c b/libunwind/src/mi/dyn-cancel.c similarity index 100% rename from src/mi/dyn-cancel.c rename to libunwind/src/mi/dyn-cancel.c diff --git a/src/mi/dyn-info-list.c b/libunwind/src/mi/dyn-info-list.c similarity index 100% rename from src/mi/dyn-info-list.c rename to libunwind/src/mi/dyn-info-list.c diff --git a/src/mi/dyn-register.c b/libunwind/src/mi/dyn-register.c similarity index 100% rename from src/mi/dyn-register.c rename to libunwind/src/mi/dyn-register.c diff --git a/src/mi/flush_cache.c b/libunwind/src/mi/flush_cache.c similarity index 100% rename from src/mi/flush_cache.c rename to libunwind/src/mi/flush_cache.c diff --git a/src/mi/init.c b/libunwind/src/mi/init.c similarity index 93% rename from src/mi/init.c rename to libunwind/src/mi/init.c index f136cbbd..60a48c58 100644 --- a/src/mi/init.c +++ b/libunwind/src/mi/init.c @@ -24,8 +24,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "libunwind_i.h" -#include "ohos-config.h" - HIDDEN intrmask_t unwi_full_mask; @@ -51,13 +49,11 @@ mi_init (void) if (str) unwi_debug_level = atoi (str); - unwi_debug_level = config_unwi_debug_level(); - if (unwi_debug_level > 0) - { - setbuf (stdout, NULL); - setbuf (stderr, NULL); - } + { + setbuf (stdout, NULL); + setbuf (stderr, NULL); + } #endif assert (sizeof (struct cursor) <= sizeof (unw_cursor_t)); diff --git a/src/mi/mempool.c b/libunwind/src/mi/mempool.c similarity index 97% rename from src/mi/mempool.c rename to libunwind/src/mi/mempool.c index baecb3f8..7c5d27d0 100644 --- a/src/mi/mempool.c +++ b/libunwind/src/mi/mempool.c @@ -40,17 +40,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ n < 16 ? 16 : n) # define MAX_ALIGN MAX_ALIGN_(sizeof (long double)) #endif -#ifndef NO_RESERVE_CACHE + static alignas(MAX_ALIGN) char sos_memory[SOS_MEMORY_SIZE]; static _Atomic size_t sos_memory_freepos = 0; -#endif static size_t pg_size; HIDDEN void * sos_alloc (size_t size) { - Dprintf("sos_alloc %zu\n", size); -#ifndef NO_RESERVE_CACHE size_t pos; size = UNW_ALIGN(size, MAX_ALIGN); @@ -64,9 +61,6 @@ sos_alloc (size_t size) assert ((pos+size) <= SOS_MEMORY_SIZE); return &sos_memory[pos]; -#else - return NULL; -#endif } /* Must be called while holding the mempool lock. */ diff --git a/src/mi/strerror.c b/libunwind/src/mi/strerror.c similarity index 100% rename from src/mi/strerror.c rename to libunwind/src/mi/strerror.c diff --git a/src/mips/Gapply_reg_state.c b/libunwind/src/mips/Gapply_reg_state.c similarity index 100% rename from src/mips/Gapply_reg_state.c rename to libunwind/src/mips/Gapply_reg_state.c diff --git a/src/mips/Gcreate_addr_space.c b/libunwind/src/mips/Gcreate_addr_space.c similarity index 100% rename from src/mips/Gcreate_addr_space.c rename to libunwind/src/mips/Gcreate_addr_space.c diff --git a/src/mips/Gget_proc_info.c b/libunwind/src/mips/Gget_proc_info.c similarity index 100% rename from src/mips/Gget_proc_info.c rename to libunwind/src/mips/Gget_proc_info.c diff --git a/src/mips/Gget_save_loc.c b/libunwind/src/mips/Gget_save_loc.c similarity index 100% rename from src/mips/Gget_save_loc.c rename to libunwind/src/mips/Gget_save_loc.c diff --git a/src/mips/Gglobal.c b/libunwind/src/mips/Gglobal.c similarity index 100% rename from src/mips/Gglobal.c rename to libunwind/src/mips/Gglobal.c diff --git a/src/mips/Ginit.c b/libunwind/src/mips/Ginit.c similarity index 100% rename from src/mips/Ginit.c rename to libunwind/src/mips/Ginit.c diff --git a/src/mips/Ginit_local.c b/libunwind/src/mips/Ginit_local.c similarity index 100% rename from src/mips/Ginit_local.c rename to libunwind/src/mips/Ginit_local.c diff --git a/src/sh/Ginit_remote.c b/libunwind/src/mips/Ginit_remote.c similarity index 100% rename from src/sh/Ginit_remote.c rename to libunwind/src/mips/Ginit_remote.c diff --git a/src/mips/Gis_signal_frame.c b/libunwind/src/mips/Gis_signal_frame.c similarity index 100% rename from src/mips/Gis_signal_frame.c rename to libunwind/src/mips/Gis_signal_frame.c diff --git a/src/mips/Greg_states_iterate.c b/libunwind/src/mips/Greg_states_iterate.c similarity index 100% rename from src/mips/Greg_states_iterate.c rename to libunwind/src/mips/Greg_states_iterate.c diff --git a/src/mips/Gregs.c b/libunwind/src/mips/Gregs.c similarity index 100% rename from src/mips/Gregs.c rename to libunwind/src/mips/Gregs.c diff --git a/src/mips/Gresume.c b/libunwind/src/mips/Gresume.c similarity index 100% rename from src/mips/Gresume.c rename to libunwind/src/mips/Gresume.c diff --git a/src/mips/Gstep.c b/libunwind/src/mips/Gstep.c similarity index 98% rename from src/mips/Gstep.c rename to libunwind/src/mips/Gstep.c index 3706cfc2..79fea71f 100644 --- a/src/mips/Gstep.c +++ b/libunwind/src/mips/Gstep.c @@ -32,7 +32,7 @@ mips_handle_signal_frame (unw_cursor_t *cursor) struct cursor *c = (struct cursor *) cursor; unw_word_t sc_addr, sp_addr = c->dwarf.cfa; unw_word_t ra, fp; - int i, ret; + int ret; switch (unw_is_signal_frame (cursor)) { case 1: @@ -51,9 +51,6 @@ mips_handle_signal_frame (unw_cursor_t *cursor) c->sigcontext_addr = sc_addr; - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - /* Update the dwarf cursor. */ c->dwarf.loc[UNW_MIPS_R0] = DWARF_LOC (sc_addr + LINUX_SC_R0_OFF, 0); c->dwarf.loc[UNW_MIPS_R1] = DWARF_LOC (sc_addr + LINUX_SC_R1_OFF, 0); diff --git a/src/mips/Lapply_reg_state.c b/libunwind/src/mips/Lapply_reg_state.c similarity index 100% rename from src/mips/Lapply_reg_state.c rename to libunwind/src/mips/Lapply_reg_state.c diff --git a/src/mips/Lcreate_addr_space.c b/libunwind/src/mips/Lcreate_addr_space.c similarity index 100% rename from src/mips/Lcreate_addr_space.c rename to libunwind/src/mips/Lcreate_addr_space.c diff --git a/src/mips/Lget_proc_info.c b/libunwind/src/mips/Lget_proc_info.c similarity index 100% rename from src/mips/Lget_proc_info.c rename to libunwind/src/mips/Lget_proc_info.c diff --git a/src/mips/Lget_save_loc.c b/libunwind/src/mips/Lget_save_loc.c similarity index 100% rename from src/mips/Lget_save_loc.c rename to libunwind/src/mips/Lget_save_loc.c diff --git a/src/mips/Lglobal.c b/libunwind/src/mips/Lglobal.c similarity index 100% rename from src/mips/Lglobal.c rename to libunwind/src/mips/Lglobal.c diff --git a/src/mips/Linit.c b/libunwind/src/mips/Linit.c similarity index 100% rename from src/mips/Linit.c rename to libunwind/src/mips/Linit.c diff --git a/src/mips/Linit_local.c b/libunwind/src/mips/Linit_local.c similarity index 100% rename from src/mips/Linit_local.c rename to libunwind/src/mips/Linit_local.c diff --git a/src/mips/Linit_remote.c b/libunwind/src/mips/Linit_remote.c similarity index 100% rename from src/mips/Linit_remote.c rename to libunwind/src/mips/Linit_remote.c diff --git a/src/ia64/Lis_signal_frame.c b/libunwind/src/mips/Lis_signal_frame.c similarity index 100% rename from src/ia64/Lis_signal_frame.c rename to libunwind/src/mips/Lis_signal_frame.c diff --git a/src/mips/Lreg_states_iterate.c b/libunwind/src/mips/Lreg_states_iterate.c similarity index 100% rename from src/mips/Lreg_states_iterate.c rename to libunwind/src/mips/Lreg_states_iterate.c diff --git a/src/mips/Lregs.c b/libunwind/src/mips/Lregs.c similarity index 100% rename from src/mips/Lregs.c rename to libunwind/src/mips/Lregs.c diff --git a/src/mips/Lresume.c b/libunwind/src/mips/Lresume.c similarity index 100% rename from src/mips/Lresume.c rename to libunwind/src/mips/Lresume.c diff --git a/src/mips/Lstep.c b/libunwind/src/mips/Lstep.c similarity index 100% rename from src/mips/Lstep.c rename to libunwind/src/mips/Lstep.c diff --git a/src/mips/getcontext.S b/libunwind/src/mips/getcontext.S similarity index 100% rename from src/mips/getcontext.S rename to libunwind/src/mips/getcontext.S diff --git a/src/mips/init.h b/libunwind/src/mips/init.h similarity index 100% rename from src/mips/init.h rename to libunwind/src/mips/init.h diff --git a/src/mips/is_fpreg.c b/libunwind/src/mips/is_fpreg.c similarity index 100% rename from src/mips/is_fpreg.c rename to libunwind/src/mips/is_fpreg.c diff --git a/src/mips/offsets.h b/libunwind/src/mips/offsets.h similarity index 100% rename from src/mips/offsets.h rename to libunwind/src/mips/offsets.h diff --git a/src/mips/regname.c b/libunwind/src/mips/regname.c similarity index 100% rename from src/mips/regname.c rename to libunwind/src/mips/regname.c diff --git a/src/mips/siglongjmp.S b/libunwind/src/mips/siglongjmp.S similarity index 100% rename from src/mips/siglongjmp.S rename to libunwind/src/mips/siglongjmp.S diff --git a/src/mips/unwind_i.h b/libunwind/src/mips/unwind_i.h similarity index 100% rename from src/mips/unwind_i.h rename to libunwind/src/mips/unwind_i.h diff --git a/src/os-freebsd.c b/libunwind/src/os-freebsd.c similarity index 100% rename from src/os-freebsd.c rename to libunwind/src/os-freebsd.c diff --git a/src/os-hpux.c b/libunwind/src/os-hpux.c similarity index 100% rename from src/os-hpux.c rename to libunwind/src/os-hpux.c diff --git a/libunwind/src/os-linux.c b/libunwind/src/os-linux.c new file mode 100644 index 00000000..c42d2c5f --- /dev/null +++ b/libunwind/src/os-linux.c @@ -0,0 +1,103 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include + +#include "libunwind_i.h" +#include "os-linux.h" + +int +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen) +{ + struct map_iterator mi; + int found = 0, rc; + unsigned long hi; + char root[sizeof ("/proc/0123456789/root")], *cp; + char *full_path; + struct stat st; + + + if (maps_init (&mi, pid) < 0) + return -1; + + while (maps_next (&mi, segbase, &hi, mapoff, NULL)) + if (ip >= *segbase && ip < hi) + { + found = 1; + break; + } + + if (!found) + { + maps_close (&mi); + return -1; + } + + full_path = mi.path; + + /* Get process root */ + memcpy (root, "/proc/", 6); + cp = unw_ltoa (root + 6, pid); + assert (cp + 6 < root + sizeof (root)); + memcpy (cp, "/root", 6); + + if (!stat(root, &st) && S_ISDIR(st.st_mode)) + { + full_path = (char*) malloc (strlen (root) + strlen (mi.path) + 1); + if (!full_path) + full_path = mi.path; + else + { + strcpy (full_path, root); + strcat (full_path, mi.path); + } + } + + if (path) + { + strncpy(path, full_path, pathlen); + } + rc = elf_map_image (ei, full_path); + + if (full_path && full_path != mi.path) + free (full_path); + + maps_close (&mi); + return rc; +} + +#ifndef UNW_REMOTE_ONLY + +void +tdep_get_exe_image_path (char *path) +{ + strcpy(path, "/proc/self/exe"); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/src/os-linux.h b/libunwind/src/os-linux.h similarity index 93% rename from src/os-linux.h rename to libunwind/src/os-linux.h index 01245c25..29aab5cf 100644 --- a/src/os-linux.h +++ b/libunwind/src/os-linux.h @@ -62,40 +62,17 @@ unw_ltoa (char *buf, long val) return buf + len; } -// now return lines of the maps -static inline int -get_maps_count(int fd) -{ - if (fd < 0) { - return -1; - } - - char buffer[1]; - int count = 0; - while(read(fd, buffer, 1) > 0) { - if (buffer[0] == '\n') { - count++; - } - } - lseek(fd, 0, SEEK_SET); - return count; -} - static inline int maps_init (struct map_iterator *mi, pid_t pid) { char path[sizeof ("/proc/0123456789/maps")], *cp; memcpy (path, "/proc/", 6); - if (pid == -1) { - memcpy (path + 6, "self/maps", 10); - } else { - cp = unw_ltoa (path + 6, pid); - assert (cp + 6 < path + sizeof (path)); - memcpy (cp, "/maps", 6); - } + cp = unw_ltoa (path + 6, pid); + assert (cp + 6 < path + sizeof (path)); + memcpy (cp, "/maps", 6); - mi->fd = UNW_TEMP_FAILURE_RETRY (open (path, O_RDONLY)); + mi->fd = open (path, O_RDONLY); if (mi->fd >= 0) { /* Try to allocate a page-sized buffer. */ diff --git a/src/os-qnx.c b/libunwind/src/os-qnx.c similarity index 100% rename from src/os-qnx.c rename to libunwind/src/os-qnx.c diff --git a/src/os-solaris.c b/libunwind/src/os-solaris.c similarity index 100% rename from src/os-solaris.c rename to libunwind/src/os-solaris.c diff --git a/src/ppc/Gget_proc_info.c b/libunwind/src/ppc/Gget_proc_info.c similarity index 100% rename from src/ppc/Gget_proc_info.c rename to libunwind/src/ppc/Gget_proc_info.c diff --git a/src/ppc/Gget_save_loc.c b/libunwind/src/ppc/Gget_save_loc.c similarity index 100% rename from src/ppc/Gget_save_loc.c rename to libunwind/src/ppc/Gget_save_loc.c diff --git a/src/ppc/Ginit_local.c b/libunwind/src/ppc/Ginit_local.c similarity index 100% rename from src/ppc/Ginit_local.c rename to libunwind/src/ppc/Ginit_local.c diff --git a/src/ppc/Ginit_remote.c b/libunwind/src/ppc/Ginit_remote.c similarity index 100% rename from src/ppc/Ginit_remote.c rename to libunwind/src/ppc/Ginit_remote.c diff --git a/src/ppc/Gis_signal_frame.c b/libunwind/src/ppc/Gis_signal_frame.c similarity index 100% rename from src/ppc/Gis_signal_frame.c rename to libunwind/src/ppc/Gis_signal_frame.c diff --git a/src/ppc/Lget_proc_info.c b/libunwind/src/ppc/Lget_proc_info.c similarity index 100% rename from src/ppc/Lget_proc_info.c rename to libunwind/src/ppc/Lget_proc_info.c diff --git a/src/ppc/Lget_save_loc.c b/libunwind/src/ppc/Lget_save_loc.c similarity index 100% rename from src/ppc/Lget_save_loc.c rename to libunwind/src/ppc/Lget_save_loc.c diff --git a/src/ppc/Linit_local.c b/libunwind/src/ppc/Linit_local.c similarity index 100% rename from src/ppc/Linit_local.c rename to libunwind/src/ppc/Linit_local.c diff --git a/src/ppc/Linit_remote.c b/libunwind/src/ppc/Linit_remote.c similarity index 100% rename from src/ppc/Linit_remote.c rename to libunwind/src/ppc/Linit_remote.c diff --git a/src/mips/Lis_signal_frame.c b/libunwind/src/ppc/Lis_signal_frame.c similarity index 100% rename from src/mips/Lis_signal_frame.c rename to libunwind/src/ppc/Lis_signal_frame.c diff --git a/src/ppc/longjmp.S b/libunwind/src/ppc/longjmp.S similarity index 100% rename from src/ppc/longjmp.S rename to libunwind/src/ppc/longjmp.S diff --git a/src/ppc/siglongjmp.S b/libunwind/src/ppc/siglongjmp.S similarity index 100% rename from src/ppc/siglongjmp.S rename to libunwind/src/ppc/siglongjmp.S diff --git a/src/ppc/Gapply_reg_state.c b/libunwind/src/ppc32/Gapply_reg_state.c similarity index 100% rename from src/ppc/Gapply_reg_state.c rename to libunwind/src/ppc32/Gapply_reg_state.c diff --git a/src/ppc32/Gcreate_addr_space.c b/libunwind/src/ppc32/Gcreate_addr_space.c similarity index 100% rename from src/ppc32/Gcreate_addr_space.c rename to libunwind/src/ppc32/Gcreate_addr_space.c diff --git a/src/ppc32/Gglobal.c b/libunwind/src/ppc32/Gglobal.c similarity index 100% rename from src/ppc32/Gglobal.c rename to libunwind/src/ppc32/Gglobal.c diff --git a/src/ppc32/Ginit.c b/libunwind/src/ppc32/Ginit.c similarity index 100% rename from src/ppc32/Ginit.c rename to libunwind/src/ppc32/Ginit.c diff --git a/src/ppc/Greg_states_iterate.c b/libunwind/src/ppc32/Greg_states_iterate.c similarity index 100% rename from src/ppc/Greg_states_iterate.c rename to libunwind/src/ppc32/Greg_states_iterate.c diff --git a/src/ppc32/Gregs.c b/libunwind/src/ppc32/Gregs.c similarity index 100% rename from src/ppc32/Gregs.c rename to libunwind/src/ppc32/Gregs.c diff --git a/src/ppc32/Gresume.c b/libunwind/src/ppc32/Gresume.c similarity index 100% rename from src/ppc32/Gresume.c rename to libunwind/src/ppc32/Gresume.c diff --git a/src/ppc32/Gstep.c b/libunwind/src/ppc32/Gstep.c similarity index 100% rename from src/ppc32/Gstep.c rename to libunwind/src/ppc32/Gstep.c diff --git a/src/ppc/Lapply_reg_state.c b/libunwind/src/ppc32/Lapply_reg_state.c similarity index 100% rename from src/ppc/Lapply_reg_state.c rename to libunwind/src/ppc32/Lapply_reg_state.c diff --git a/src/ppc32/Lcreate_addr_space.c b/libunwind/src/ppc32/Lcreate_addr_space.c similarity index 100% rename from src/ppc32/Lcreate_addr_space.c rename to libunwind/src/ppc32/Lcreate_addr_space.c diff --git a/src/ppc32/Lglobal.c b/libunwind/src/ppc32/Lglobal.c similarity index 100% rename from src/ppc32/Lglobal.c rename to libunwind/src/ppc32/Lglobal.c diff --git a/src/ppc32/Linit.c b/libunwind/src/ppc32/Linit.c similarity index 100% rename from src/ppc32/Linit.c rename to libunwind/src/ppc32/Linit.c diff --git a/src/ppc/Lreg_states_iterate.c b/libunwind/src/ppc32/Lreg_states_iterate.c similarity index 100% rename from src/ppc/Lreg_states_iterate.c rename to libunwind/src/ppc32/Lreg_states_iterate.c diff --git a/src/ppc32/Lregs.c b/libunwind/src/ppc32/Lregs.c similarity index 100% rename from src/ppc32/Lregs.c rename to libunwind/src/ppc32/Lregs.c diff --git a/src/ppc32/Lresume.c b/libunwind/src/ppc32/Lresume.c similarity index 100% rename from src/ppc32/Lresume.c rename to libunwind/src/ppc32/Lresume.c diff --git a/src/ppc32/Lstep.c b/libunwind/src/ppc32/Lstep.c similarity index 100% rename from src/ppc32/Lstep.c rename to libunwind/src/ppc32/Lstep.c diff --git a/src/ppc32/get_func_addr.c b/libunwind/src/ppc32/get_func_addr.c similarity index 100% rename from src/ppc32/get_func_addr.c rename to libunwind/src/ppc32/get_func_addr.c diff --git a/src/ppc32/init.h b/libunwind/src/ppc32/init.h similarity index 100% rename from src/ppc32/init.h rename to libunwind/src/ppc32/init.h diff --git a/src/ppc32/is_fpreg.c b/libunwind/src/ppc32/is_fpreg.c similarity index 100% rename from src/ppc32/is_fpreg.c rename to libunwind/src/ppc32/is_fpreg.c diff --git a/src/ppc32/regname.c b/libunwind/src/ppc32/regname.c similarity index 100% rename from src/ppc32/regname.c rename to libunwind/src/ppc32/regname.c diff --git a/src/ppc32/ucontext_i.h b/libunwind/src/ppc32/ucontext_i.h similarity index 100% rename from src/ppc32/ucontext_i.h rename to libunwind/src/ppc32/ucontext_i.h diff --git a/src/ppc32/unwind_i.h b/libunwind/src/ppc32/unwind_i.h similarity index 100% rename from src/ppc32/unwind_i.h rename to libunwind/src/ppc32/unwind_i.h diff --git a/src/ppc32/Gapply_reg_state.c b/libunwind/src/ppc64/Gapply_reg_state.c similarity index 100% rename from src/ppc32/Gapply_reg_state.c rename to libunwind/src/ppc64/Gapply_reg_state.c diff --git a/src/ppc64/Gcreate_addr_space.c b/libunwind/src/ppc64/Gcreate_addr_space.c similarity index 100% rename from src/ppc64/Gcreate_addr_space.c rename to libunwind/src/ppc64/Gcreate_addr_space.c diff --git a/src/ppc64/Gglobal.c b/libunwind/src/ppc64/Gglobal.c similarity index 100% rename from src/ppc64/Gglobal.c rename to libunwind/src/ppc64/Gglobal.c diff --git a/src/ppc64/Ginit.c b/libunwind/src/ppc64/Ginit.c similarity index 100% rename from src/ppc64/Ginit.c rename to libunwind/src/ppc64/Ginit.c diff --git a/src/ppc32/Greg_states_iterate.c b/libunwind/src/ppc64/Greg_states_iterate.c similarity index 100% rename from src/ppc32/Greg_states_iterate.c rename to libunwind/src/ppc64/Greg_states_iterate.c diff --git a/src/ppc64/Gregs.c b/libunwind/src/ppc64/Gregs.c similarity index 100% rename from src/ppc64/Gregs.c rename to libunwind/src/ppc64/Gregs.c diff --git a/src/ppc64/Gresume.c b/libunwind/src/ppc64/Gresume.c similarity index 100% rename from src/ppc64/Gresume.c rename to libunwind/src/ppc64/Gresume.c diff --git a/src/ppc64/Gstep.c b/libunwind/src/ppc64/Gstep.c similarity index 100% rename from src/ppc64/Gstep.c rename to libunwind/src/ppc64/Gstep.c diff --git a/src/ppc32/Lapply_reg_state.c b/libunwind/src/ppc64/Lapply_reg_state.c similarity index 100% rename from src/ppc32/Lapply_reg_state.c rename to libunwind/src/ppc64/Lapply_reg_state.c diff --git a/src/ppc64/Lcreate_addr_space.c b/libunwind/src/ppc64/Lcreate_addr_space.c similarity index 100% rename from src/ppc64/Lcreate_addr_space.c rename to libunwind/src/ppc64/Lcreate_addr_space.c diff --git a/src/ppc64/Lglobal.c b/libunwind/src/ppc64/Lglobal.c similarity index 100% rename from src/ppc64/Lglobal.c rename to libunwind/src/ppc64/Lglobal.c diff --git a/src/ppc64/Linit.c b/libunwind/src/ppc64/Linit.c similarity index 100% rename from src/ppc64/Linit.c rename to libunwind/src/ppc64/Linit.c diff --git a/src/ppc32/Lreg_states_iterate.c b/libunwind/src/ppc64/Lreg_states_iterate.c similarity index 100% rename from src/ppc32/Lreg_states_iterate.c rename to libunwind/src/ppc64/Lreg_states_iterate.c diff --git a/src/ppc64/Lregs.c b/libunwind/src/ppc64/Lregs.c similarity index 100% rename from src/ppc64/Lregs.c rename to libunwind/src/ppc64/Lregs.c diff --git a/src/ppc64/Lresume.c b/libunwind/src/ppc64/Lresume.c similarity index 100% rename from src/ppc64/Lresume.c rename to libunwind/src/ppc64/Lresume.c diff --git a/src/ppc64/Lstep.c b/libunwind/src/ppc64/Lstep.c similarity index 100% rename from src/ppc64/Lstep.c rename to libunwind/src/ppc64/Lstep.c diff --git a/src/ppc64/get_func_addr.c b/libunwind/src/ppc64/get_func_addr.c similarity index 100% rename from src/ppc64/get_func_addr.c rename to libunwind/src/ppc64/get_func_addr.c diff --git a/src/ppc64/init.h b/libunwind/src/ppc64/init.h similarity index 100% rename from src/ppc64/init.h rename to libunwind/src/ppc64/init.h diff --git a/src/ppc64/is_fpreg.c b/libunwind/src/ppc64/is_fpreg.c similarity index 100% rename from src/ppc64/is_fpreg.c rename to libunwind/src/ppc64/is_fpreg.c diff --git a/src/ppc64/regname.c b/libunwind/src/ppc64/regname.c similarity index 100% rename from src/ppc64/regname.c rename to libunwind/src/ppc64/regname.c diff --git a/src/ppc64/ucontext_i.h b/libunwind/src/ppc64/ucontext_i.h similarity index 100% rename from src/ppc64/ucontext_i.h rename to libunwind/src/ppc64/ucontext_i.h diff --git a/src/ppc64/unwind_i.h b/libunwind/src/ppc64/unwind_i.h similarity index 100% rename from src/ppc64/unwind_i.h rename to libunwind/src/ppc64/unwind_i.h diff --git a/src/ptrace/_UPT_access_fpreg.c b/libunwind/src/ptrace/_UPT_access_fpreg.c similarity index 100% rename from src/ptrace/_UPT_access_fpreg.c rename to libunwind/src/ptrace/_UPT_access_fpreg.c diff --git a/src/ptrace/_UPT_access_mem.c b/libunwind/src/ptrace/_UPT_access_mem.c similarity index 100% rename from src/ptrace/_UPT_access_mem.c rename to libunwind/src/ptrace/_UPT_access_mem.c diff --git a/src/ptrace/_UPT_access_reg.c b/libunwind/src/ptrace/_UPT_access_reg.c similarity index 97% rename from src/ptrace/_UPT_access_reg.c rename to libunwind/src/ptrace/_UPT_access_reg.c index 975387b3..0e247053 100644 --- a/src/ptrace/_UPT_access_reg.c +++ b/libunwind/src/ptrace/_UPT_access_reg.c @@ -74,7 +74,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, return 0; badreg: - Dprintf ("bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno)); + Debug (1, "bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno)); return -UNW_EBADREG; } #elif HAVE_DECL_PTRACE_POKEUSER || HAVE_TTRACE @@ -318,7 +318,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, return 0; badreg: - Dprintf ("bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno)); + Debug (1, "bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno)); return -UNW_EBADREG; } #elif HAVE_DECL_PT_GETREGS @@ -354,7 +354,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, return 0; badreg: - Dprintf ("bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno)); + Debug (1, "bad register %s [%u] (error: %s)\n", unw_regname(reg), reg, strerror (errno)); return -UNW_EBADREG; } #else diff --git a/src/ptrace/_UPT_accessors.c b/libunwind/src/ptrace/_UPT_accessors.c similarity index 82% rename from src/ptrace/_UPT_accessors.c rename to libunwind/src/ptrace/_UPT_accessors.c index 7af4e013..4724360b 100644 --- a/src/ptrace/_UPT_accessors.c +++ b/libunwind/src/ptrace/_UPT_accessors.c @@ -25,16 +25,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "_UPT_internal.h" -#ifdef __aarch64__ -// we may use ptrace to get real mask -static unw_word_t _UPT_ptrauth_insn_mask(unw_addr_space_t as, void *arg) -{ - (void) as; - (void) arg; - return 0xFFFFFF8000000000; // mask all bits from [63:40] -} -#endif - unw_accessors_t _UPT_accessors = { .find_proc_info = _UPT_find_proc_info, @@ -44,8 +34,5 @@ unw_accessors_t _UPT_accessors = .access_reg = _UPT_access_reg, .access_fpreg = _UPT_access_fpreg, .resume = _UPT_resume, - .get_proc_name = _UPT_get_proc_name, -#ifdef __aarch64__ - .ptrauth_insn_mask = _UPT_ptrauth_insn_mask -#endif + .get_proc_name = _UPT_get_proc_name }; diff --git a/src/ptrace/_UPT_create.c b/libunwind/src/ptrace/_UPT_create.c similarity index 100% rename from src/ptrace/_UPT_create.c rename to libunwind/src/ptrace/_UPT_create.c diff --git a/src/ptrace/_UPT_destroy.c b/libunwind/src/ptrace/_UPT_destroy.c similarity index 100% rename from src/ptrace/_UPT_destroy.c rename to libunwind/src/ptrace/_UPT_destroy.c diff --git a/src/ptrace/_UPT_elf.c b/libunwind/src/ptrace/_UPT_elf.c similarity index 100% rename from src/ptrace/_UPT_elf.c rename to libunwind/src/ptrace/_UPT_elf.c diff --git a/src/ptrace/_UPT_find_proc_info.c b/libunwind/src/ptrace/_UPT_find_proc_info.c similarity index 92% rename from src/ptrace/_UPT_find_proc_info.c rename to libunwind/src/ptrace/_UPT_find_proc_info.c index ef2912b7..0450b084 100644 --- a/src/ptrace/_UPT_find_proc_info.c +++ b/libunwind/src/ptrace/_UPT_find_proc_info.c @@ -35,8 +35,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static int get_unwind_info (struct elf_dyn_info *edi, pid_t pid, unw_addr_space_t as, unw_word_t ip) { + unsigned long segbase, mapoff; + char path[PATH_MAX]; - struct map_info *map; #if UNW_TARGET_IA64 && defined(__linux__) if (!edi->ktab.start_ip && _Uia64_get_kernel_table (&edi->ktab) < 0) return -UNW_ENOINFO; @@ -57,14 +58,14 @@ get_unwind_info (struct elf_dyn_info *edi, pid_t pid, unw_addr_space_t as, unw_w invalidate_edi(edi); - /* Add For Cache MAP And ELF */ - map = tdep_get_elf_image (as, pid, ip); - if (map == NULL) + if (tdep_get_elf_image (&edi->ei, pid, ip, &segbase, &mapoff, path, + sizeof(path)) < 0) return -UNW_ENOINFO; - if (tdep_find_unwind_table (edi, &map->ei, as, map->path, map->start, map->offset, ip) < 0) + /* Here, SEGBASE is the starting-address of the (mmap'ped) segment + which covers the IP we're looking for. */ + if (tdep_find_unwind_table (edi, as, path, segbase, mapoff, ip) < 0) return -UNW_ENOINFO; - /* Add For Cache MAP And ELF */ /* This can happen in corner cases where dynamically generated code falls into the same page that contains the data-segment diff --git a/src/ptrace/_UPT_get_dyn_info_list_addr.c b/libunwind/src/ptrace/_UPT_get_dyn_info_list_addr.c similarity index 98% rename from src/ptrace/_UPT_get_dyn_info_list_addr.c rename to libunwind/src/ptrace/_UPT_get_dyn_info_list_addr.c index 23f0b8d3..a71f80d3 100644 --- a/src/ptrace/_UPT_get_dyn_info_list_addr.c +++ b/libunwind/src/ptrace/_UPT_get_dyn_info_list_addr.c @@ -80,7 +80,7 @@ static inline int get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg, int *countp) { -//# warning Implement get_list_addr(), please. +# warning Implement get_list_addr(), please. *countp = 0; return 0; } diff --git a/src/ptrace/_UPT_get_proc_name.c b/libunwind/src/ptrace/_UPT_get_proc_name.c similarity index 100% rename from src/ptrace/_UPT_get_proc_name.c rename to libunwind/src/ptrace/_UPT_get_proc_name.c diff --git a/src/ptrace/_UPT_internal.h b/libunwind/src/ptrace/_UPT_internal.h old mode 100755 new mode 100644 similarity index 100% rename from src/ptrace/_UPT_internal.h rename to libunwind/src/ptrace/_UPT_internal.h diff --git a/src/ptrace/_UPT_put_unwind_info.c b/libunwind/src/ptrace/_UPT_put_unwind_info.c similarity index 100% rename from src/ptrace/_UPT_put_unwind_info.c rename to libunwind/src/ptrace/_UPT_put_unwind_info.c diff --git a/src/ptrace/_UPT_reg_offset.c b/libunwind/src/ptrace/_UPT_reg_offset.c similarity index 100% rename from src/ptrace/_UPT_reg_offset.c rename to libunwind/src/ptrace/_UPT_reg_offset.c diff --git a/src/ptrace/_UPT_resume.c b/libunwind/src/ptrace/_UPT_resume.c similarity index 100% rename from src/ptrace/_UPT_resume.c rename to libunwind/src/ptrace/_UPT_resume.c diff --git a/src/ptrace/libunwind-ptrace.pc.in b/libunwind/src/ptrace/libunwind-ptrace.pc.in similarity index 100% rename from src/ptrace/libunwind-ptrace.pc.in rename to libunwind/src/ptrace/libunwind-ptrace.pc.in diff --git a/src/riscv/Gapply_reg_state.c b/libunwind/src/riscv/Gapply_reg_state.c similarity index 100% rename from src/riscv/Gapply_reg_state.c rename to libunwind/src/riscv/Gapply_reg_state.c diff --git a/src/riscv/Gcreate_addr_space.c b/libunwind/src/riscv/Gcreate_addr_space.c similarity index 100% rename from src/riscv/Gcreate_addr_space.c rename to libunwind/src/riscv/Gcreate_addr_space.c diff --git a/src/riscv/Gget_proc_info.c b/libunwind/src/riscv/Gget_proc_info.c similarity index 100% rename from src/riscv/Gget_proc_info.c rename to libunwind/src/riscv/Gget_proc_info.c diff --git a/src/riscv/Gget_save_loc.c b/libunwind/src/riscv/Gget_save_loc.c similarity index 100% rename from src/riscv/Gget_save_loc.c rename to libunwind/src/riscv/Gget_save_loc.c diff --git a/src/riscv/Gglobal.c b/libunwind/src/riscv/Gglobal.c similarity index 99% rename from src/riscv/Gglobal.c rename to libunwind/src/riscv/Gglobal.c index cb8009e1..65f11b35 100644 --- a/src/riscv/Gglobal.c +++ b/libunwind/src/riscv/Gglobal.c @@ -115,10 +115,9 @@ tdep_init (void) mi_init (); dwarf_init (); - -#ifndef UNW_REMOTE_ONLY tdep_init_mem_validate (); +#ifndef UNW_REMOTE_ONLY riscv_local_addr_space_init (); #endif atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ diff --git a/src/riscv/Ginit.c b/libunwind/src/riscv/Ginit.c similarity index 94% rename from src/riscv/Ginit.c rename to libunwind/src/riscv/Ginit.c index e45bafdf..907f7296 100644 --- a/src/riscv/Ginit.c +++ b/libunwind/src/riscv/Ginit.c @@ -445,21 +445,4 @@ riscv_local_addr_space_init (void) unw_flush_cache (&local_addr_space, 0, 0); } -HIDDEN void -init_local_addr_space (unw_addr_space_t as) -{ - memset (as, 0, sizeof (struct unw_addr_space)); - as->caching_policy = UNW_CACHE_GLOBAL; - as->acc.find_proc_info = dwarf_find_proc_info; - as->acc.put_unwind_info = put_unwind_info; - as->acc.get_dyn_info_list_addr = get_dyn_info_list_addr; - as->acc.access_mem = access_mem; - as->acc.access_reg = access_reg; - as->acc.access_fpreg = access_fpreg; - as->acc.resume = riscv_local_resume; - as->acc.get_proc_name = get_static_proc_name; - as->big_endian = target_is_big_endian(); - unw_flush_cache (as, 0, 0); -} - #endif /* !UNW_REMOTE_ONLY */ diff --git a/src/riscv/Ginit_local.c b/libunwind/src/riscv/Ginit_local.c similarity index 86% rename from src/riscv/Ginit_local.c rename to libunwind/src/riscv/Ginit_local.c index 67c4eaa1..255e75a2 100644 --- a/src/riscv/Ginit_local.c +++ b/libunwind/src/riscv/Ginit_local.c @@ -55,23 +55,6 @@ unw_init_local_common(unw_cursor_t *cursor, ucontext_t *uc, unsigned use_prev_in return common_init (c, use_prev_instr); } -int -unw_init_local_with_as(unw_addr_space_t as, unw_cursor_t *cursor, unw_context_t *uc) -{ - struct cursor *c = (struct cursor *) cursor; - - if (!atomic_load(&tdep_init_done)) - tdep_init (); - - unw_local_addr_space = as; - c->dwarf.as = as; - c->dwarf.as_arg = cursor; - c->uc = uc; - c->validate = 1; - - return common_init (c, 1); -} - int unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) { diff --git a/src/riscv/Ginit_remote.c b/libunwind/src/riscv/Ginit_remote.c similarity index 100% rename from src/riscv/Ginit_remote.c rename to libunwind/src/riscv/Ginit_remote.c diff --git a/src/riscv/Gis_signal_frame.c b/libunwind/src/riscv/Gis_signal_frame.c similarity index 100% rename from src/riscv/Gis_signal_frame.c rename to libunwind/src/riscv/Gis_signal_frame.c diff --git a/src/riscv/Greg_states_iterate.c b/libunwind/src/riscv/Greg_states_iterate.c similarity index 100% rename from src/riscv/Greg_states_iterate.c rename to libunwind/src/riscv/Greg_states_iterate.c diff --git a/src/riscv/Gregs.c b/libunwind/src/riscv/Gregs.c similarity index 100% rename from src/riscv/Gregs.c rename to libunwind/src/riscv/Gregs.c diff --git a/src/riscv/Gresume.c b/libunwind/src/riscv/Gresume.c similarity index 100% rename from src/riscv/Gresume.c rename to libunwind/src/riscv/Gresume.c diff --git a/src/riscv/Gstep.c b/libunwind/src/riscv/Gstep.c similarity index 100% rename from src/riscv/Gstep.c rename to libunwind/src/riscv/Gstep.c diff --git a/src/ppc64/Lapply_reg_state.c b/libunwind/src/riscv/Lapply_reg_state.c similarity index 100% rename from src/ppc64/Lapply_reg_state.c rename to libunwind/src/riscv/Lapply_reg_state.c diff --git a/src/riscv/Lcreate_addr_space.c b/libunwind/src/riscv/Lcreate_addr_space.c similarity index 100% rename from src/riscv/Lcreate_addr_space.c rename to libunwind/src/riscv/Lcreate_addr_space.c diff --git a/src/riscv/Lget_proc_info.c b/libunwind/src/riscv/Lget_proc_info.c similarity index 100% rename from src/riscv/Lget_proc_info.c rename to libunwind/src/riscv/Lget_proc_info.c diff --git a/src/riscv/Lget_save_loc.c b/libunwind/src/riscv/Lget_save_loc.c similarity index 100% rename from src/riscv/Lget_save_loc.c rename to libunwind/src/riscv/Lget_save_loc.c diff --git a/src/riscv/Lglobal.c b/libunwind/src/riscv/Lglobal.c similarity index 100% rename from src/riscv/Lglobal.c rename to libunwind/src/riscv/Lglobal.c diff --git a/src/riscv/Linit.c b/libunwind/src/riscv/Linit.c similarity index 100% rename from src/riscv/Linit.c rename to libunwind/src/riscv/Linit.c diff --git a/src/riscv/Linit_local.c b/libunwind/src/riscv/Linit_local.c similarity index 100% rename from src/riscv/Linit_local.c rename to libunwind/src/riscv/Linit_local.c diff --git a/src/riscv/Linit_remote.c b/libunwind/src/riscv/Linit_remote.c similarity index 100% rename from src/riscv/Linit_remote.c rename to libunwind/src/riscv/Linit_remote.c diff --git a/src/ppc/Lis_signal_frame.c b/libunwind/src/riscv/Lis_signal_frame.c similarity index 100% rename from src/ppc/Lis_signal_frame.c rename to libunwind/src/riscv/Lis_signal_frame.c diff --git a/src/ppc64/Lreg_states_iterate.c b/libunwind/src/riscv/Lreg_states_iterate.c similarity index 100% rename from src/ppc64/Lreg_states_iterate.c rename to libunwind/src/riscv/Lreg_states_iterate.c diff --git a/src/riscv/Lregs.c b/libunwind/src/riscv/Lregs.c similarity index 100% rename from src/riscv/Lregs.c rename to libunwind/src/riscv/Lregs.c diff --git a/src/riscv/Lresume.c b/libunwind/src/riscv/Lresume.c similarity index 100% rename from src/riscv/Lresume.c rename to libunwind/src/riscv/Lresume.c diff --git a/src/riscv/Lstep.c b/libunwind/src/riscv/Lstep.c similarity index 100% rename from src/riscv/Lstep.c rename to libunwind/src/riscv/Lstep.c diff --git a/src/riscv/asm.h b/libunwind/src/riscv/asm.h similarity index 100% rename from src/riscv/asm.h rename to libunwind/src/riscv/asm.h diff --git a/src/riscv/getcontext.S b/libunwind/src/riscv/getcontext.S similarity index 100% rename from src/riscv/getcontext.S rename to libunwind/src/riscv/getcontext.S diff --git a/src/riscv/init.h b/libunwind/src/riscv/init.h similarity index 100% rename from src/riscv/init.h rename to libunwind/src/riscv/init.h diff --git a/src/riscv/is_fpreg.c b/libunwind/src/riscv/is_fpreg.c similarity index 100% rename from src/riscv/is_fpreg.c rename to libunwind/src/riscv/is_fpreg.c diff --git a/src/riscv/offsets.h b/libunwind/src/riscv/offsets.h similarity index 100% rename from src/riscv/offsets.h rename to libunwind/src/riscv/offsets.h diff --git a/src/riscv/regname.c b/libunwind/src/riscv/regname.c similarity index 100% rename from src/riscv/regname.c rename to libunwind/src/riscv/regname.c diff --git a/src/riscv/setcontext.S b/libunwind/src/riscv/setcontext.S similarity index 100% rename from src/riscv/setcontext.S rename to libunwind/src/riscv/setcontext.S diff --git a/src/riscv/siglongjmp.S b/libunwind/src/riscv/siglongjmp.S similarity index 100% rename from src/riscv/siglongjmp.S rename to libunwind/src/riscv/siglongjmp.S diff --git a/src/riscv/unwind_i.h b/libunwind/src/riscv/unwind_i.h similarity index 96% rename from src/riscv/unwind_i.h rename to libunwind/src/riscv/unwind_i.h index 6a7904ad..3a045da0 100644 --- a/src/riscv/unwind_i.h +++ b/libunwind/src/riscv/unwind_i.h @@ -36,7 +36,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define riscv_local_resume UNW_OBJ(local_resume) #define riscv_local_addr_space_init UNW_OBJ(local_addr_space_init) #define setcontext UNW_ARCH_OBJ (setcontext) -#define init_local_addr_space UNW_OBJ(init_local_addr_space) extern void riscv_local_addr_space_init (void); extern int riscv_local_resume (unw_addr_space_t as, diff --git a/src/ppc64/Gapply_reg_state.c b/libunwind/src/s390x/Gapply_reg_state.c similarity index 100% rename from src/ppc64/Gapply_reg_state.c rename to libunwind/src/s390x/Gapply_reg_state.c diff --git a/src/s390x/Gcreate_addr_space.c b/libunwind/src/s390x/Gcreate_addr_space.c similarity index 100% rename from src/s390x/Gcreate_addr_space.c rename to libunwind/src/s390x/Gcreate_addr_space.c diff --git a/src/s390x/Gget_proc_info.c b/libunwind/src/s390x/Gget_proc_info.c similarity index 100% rename from src/s390x/Gget_proc_info.c rename to libunwind/src/s390x/Gget_proc_info.c diff --git a/src/s390x/Gget_save_loc.c b/libunwind/src/s390x/Gget_save_loc.c similarity index 100% rename from src/s390x/Gget_save_loc.c rename to libunwind/src/s390x/Gget_save_loc.c diff --git a/src/s390x/Gglobal.c b/libunwind/src/s390x/Gglobal.c similarity index 100% rename from src/s390x/Gglobal.c rename to libunwind/src/s390x/Gglobal.c index 20544a57..be49c3f6 100644 --- a/src/s390x/Gglobal.c +++ b/libunwind/src/s390x/Gglobal.c @@ -89,9 +89,9 @@ tdep_init (void) dwarf_init (); -#ifndef UNW_REMOTE_ONLY tdep_init_mem_validate (); +#ifndef UNW_REMOTE_ONLY s390x_local_addr_space_init (); #endif atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ diff --git a/src/s390x/Ginit.c b/libunwind/src/s390x/Ginit.c similarity index 100% rename from src/s390x/Ginit.c rename to libunwind/src/s390x/Ginit.c diff --git a/src/s390x/Ginit_local.c b/libunwind/src/s390x/Ginit_local.c similarity index 100% rename from src/s390x/Ginit_local.c rename to libunwind/src/s390x/Ginit_local.c diff --git a/src/s390x/Ginit_remote.c b/libunwind/src/s390x/Ginit_remote.c similarity index 100% rename from src/s390x/Ginit_remote.c rename to libunwind/src/s390x/Ginit_remote.c diff --git a/src/s390x/Gis_signal_frame.c b/libunwind/src/s390x/Gis_signal_frame.c similarity index 100% rename from src/s390x/Gis_signal_frame.c rename to libunwind/src/s390x/Gis_signal_frame.c diff --git a/src/ppc64/Greg_states_iterate.c b/libunwind/src/s390x/Greg_states_iterate.c similarity index 100% rename from src/ppc64/Greg_states_iterate.c rename to libunwind/src/s390x/Greg_states_iterate.c diff --git a/src/s390x/Gregs.c b/libunwind/src/s390x/Gregs.c similarity index 100% rename from src/s390x/Gregs.c rename to libunwind/src/s390x/Gregs.c diff --git a/src/s390x/Gresume.c b/libunwind/src/s390x/Gresume.c similarity index 100% rename from src/s390x/Gresume.c rename to libunwind/src/s390x/Gresume.c diff --git a/src/s390x/Gstep.c b/libunwind/src/s390x/Gstep.c similarity index 100% rename from src/s390x/Gstep.c rename to libunwind/src/s390x/Gstep.c diff --git a/src/riscv/Lapply_reg_state.c b/libunwind/src/s390x/Lapply_reg_state.c similarity index 100% rename from src/riscv/Lapply_reg_state.c rename to libunwind/src/s390x/Lapply_reg_state.c diff --git a/src/s390x/Lcreate_addr_space.c b/libunwind/src/s390x/Lcreate_addr_space.c similarity index 100% rename from src/s390x/Lcreate_addr_space.c rename to libunwind/src/s390x/Lcreate_addr_space.c diff --git a/src/s390x/Lget_proc_info.c b/libunwind/src/s390x/Lget_proc_info.c similarity index 100% rename from src/s390x/Lget_proc_info.c rename to libunwind/src/s390x/Lget_proc_info.c diff --git a/src/s390x/Lget_save_loc.c b/libunwind/src/s390x/Lget_save_loc.c similarity index 100% rename from src/s390x/Lget_save_loc.c rename to libunwind/src/s390x/Lget_save_loc.c diff --git a/src/s390x/Lglobal.c b/libunwind/src/s390x/Lglobal.c similarity index 100% rename from src/s390x/Lglobal.c rename to libunwind/src/s390x/Lglobal.c diff --git a/src/s390x/Linit.c b/libunwind/src/s390x/Linit.c similarity index 100% rename from src/s390x/Linit.c rename to libunwind/src/s390x/Linit.c diff --git a/src/s390x/Linit_local.c b/libunwind/src/s390x/Linit_local.c similarity index 100% rename from src/s390x/Linit_local.c rename to libunwind/src/s390x/Linit_local.c diff --git a/src/s390x/Linit_remote.c b/libunwind/src/s390x/Linit_remote.c similarity index 100% rename from src/s390x/Linit_remote.c rename to libunwind/src/s390x/Linit_remote.c diff --git a/src/riscv/Lis_signal_frame.c b/libunwind/src/s390x/Lis_signal_frame.c similarity index 100% rename from src/riscv/Lis_signal_frame.c rename to libunwind/src/s390x/Lis_signal_frame.c diff --git a/src/riscv/Lreg_states_iterate.c b/libunwind/src/s390x/Lreg_states_iterate.c similarity index 100% rename from src/riscv/Lreg_states_iterate.c rename to libunwind/src/s390x/Lreg_states_iterate.c diff --git a/src/s390x/Lregs.c b/libunwind/src/s390x/Lregs.c similarity index 100% rename from src/s390x/Lregs.c rename to libunwind/src/s390x/Lregs.c diff --git a/src/s390x/Lresume.c b/libunwind/src/s390x/Lresume.c similarity index 100% rename from src/s390x/Lresume.c rename to libunwind/src/s390x/Lresume.c diff --git a/src/s390x/Lstep.c b/libunwind/src/s390x/Lstep.c similarity index 100% rename from src/s390x/Lstep.c rename to libunwind/src/s390x/Lstep.c diff --git a/src/s390x/getcontext.S b/libunwind/src/s390x/getcontext.S similarity index 100% rename from src/s390x/getcontext.S rename to libunwind/src/s390x/getcontext.S diff --git a/src/s390x/init.h b/libunwind/src/s390x/init.h similarity index 100% rename from src/s390x/init.h rename to libunwind/src/s390x/init.h diff --git a/src/s390x/is_fpreg.c b/libunwind/src/s390x/is_fpreg.c similarity index 100% rename from src/s390x/is_fpreg.c rename to libunwind/src/s390x/is_fpreg.c diff --git a/src/s390x/regname.c b/libunwind/src/s390x/regname.c similarity index 100% rename from src/s390x/regname.c rename to libunwind/src/s390x/regname.c diff --git a/src/s390x/setcontext.S b/libunwind/src/s390x/setcontext.S similarity index 100% rename from src/s390x/setcontext.S rename to libunwind/src/s390x/setcontext.S diff --git a/src/s390x/unwind_i.h b/libunwind/src/s390x/unwind_i.h similarity index 100% rename from src/s390x/unwind_i.h rename to libunwind/src/s390x/unwind_i.h diff --git a/src/setjmp/libunwind-setjmp.pc.in b/libunwind/src/setjmp/libunwind-setjmp.pc.in similarity index 100% rename from src/setjmp/libunwind-setjmp.pc.in rename to libunwind/src/setjmp/libunwind-setjmp.pc.in diff --git a/src/setjmp/longjmp.c b/libunwind/src/setjmp/longjmp.c similarity index 100% rename from src/setjmp/longjmp.c rename to libunwind/src/setjmp/longjmp.c diff --git a/src/setjmp/setjmp_i.h b/libunwind/src/setjmp/setjmp_i.h similarity index 100% rename from src/setjmp/setjmp_i.h rename to libunwind/src/setjmp/setjmp_i.h diff --git a/src/setjmp/siglongjmp.c b/libunwind/src/setjmp/siglongjmp.c similarity index 100% rename from src/setjmp/siglongjmp.c rename to libunwind/src/setjmp/siglongjmp.c diff --git a/src/s390x/Gapply_reg_state.c b/libunwind/src/sh/Gapply_reg_state.c similarity index 100% rename from src/s390x/Gapply_reg_state.c rename to libunwind/src/sh/Gapply_reg_state.c diff --git a/src/sh/Gcreate_addr_space.c b/libunwind/src/sh/Gcreate_addr_space.c similarity index 100% rename from src/sh/Gcreate_addr_space.c rename to libunwind/src/sh/Gcreate_addr_space.c diff --git a/src/sh/Gget_proc_info.c b/libunwind/src/sh/Gget_proc_info.c similarity index 100% rename from src/sh/Gget_proc_info.c rename to libunwind/src/sh/Gget_proc_info.c diff --git a/src/sh/Gget_save_loc.c b/libunwind/src/sh/Gget_save_loc.c similarity index 100% rename from src/sh/Gget_save_loc.c rename to libunwind/src/sh/Gget_save_loc.c diff --git a/src/sh/Gglobal.c b/libunwind/src/sh/Gglobal.c similarity index 100% rename from src/sh/Gglobal.c rename to libunwind/src/sh/Gglobal.c diff --git a/src/sh/Ginit.c b/libunwind/src/sh/Ginit.c similarity index 100% rename from src/sh/Ginit.c rename to libunwind/src/sh/Ginit.c diff --git a/src/sh/Ginit_local.c b/libunwind/src/sh/Ginit_local.c similarity index 100% rename from src/sh/Ginit_local.c rename to libunwind/src/sh/Ginit_local.c diff --git a/src/arm/Ginit_remote.c b/libunwind/src/sh/Ginit_remote.c similarity index 93% rename from src/arm/Ginit_remote.c rename to libunwind/src/sh/Ginit_remote.c index f89bc578..26d11ba9 100644 --- a/src/arm/Ginit_remote.c +++ b/libunwind/src/sh/Ginit_remote.c @@ -39,11 +39,7 @@ unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) Debug (1, "(cursor=%p)\n", c); c->dwarf.as = as; - c->dwarf.as->cursor = c; c->dwarf.as_arg = as_arg; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; return common_init (c, 0); #endif /* !UNW_LOCAL_ONLY */ } diff --git a/src/sh/Gis_signal_frame.c b/libunwind/src/sh/Gis_signal_frame.c similarity index 100% rename from src/sh/Gis_signal_frame.c rename to libunwind/src/sh/Gis_signal_frame.c diff --git a/src/s390x/Greg_states_iterate.c b/libunwind/src/sh/Greg_states_iterate.c similarity index 100% rename from src/s390x/Greg_states_iterate.c rename to libunwind/src/sh/Greg_states_iterate.c diff --git a/src/sh/Gregs.c b/libunwind/src/sh/Gregs.c similarity index 100% rename from src/sh/Gregs.c rename to libunwind/src/sh/Gregs.c diff --git a/src/sh/Gresume.c b/libunwind/src/sh/Gresume.c similarity index 100% rename from src/sh/Gresume.c rename to libunwind/src/sh/Gresume.c diff --git a/src/sh/Gstep.c b/libunwind/src/sh/Gstep.c similarity index 97% rename from src/sh/Gstep.c rename to libunwind/src/sh/Gstep.c index 2c6a96c5..60d7ec2b 100644 --- a/src/sh/Gstep.c +++ b/libunwind/src/sh/Gstep.c @@ -31,7 +31,7 @@ static int sh_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; - int i, ret; + int ret; unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); @@ -63,9 +63,6 @@ sh_handle_signal_frame (unw_cursor_t *cursor) c->sigcontext_addr = sc_addr; - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - /* Update the dwarf cursor. Set the location of the registers to the corresponding addresses of the uc_mcontext / sigcontext structure contents. */ diff --git a/src/s390x/Lapply_reg_state.c b/libunwind/src/sh/Lapply_reg_state.c similarity index 100% rename from src/s390x/Lapply_reg_state.c rename to libunwind/src/sh/Lapply_reg_state.c diff --git a/src/sh/Lcreate_addr_space.c b/libunwind/src/sh/Lcreate_addr_space.c similarity index 100% rename from src/sh/Lcreate_addr_space.c rename to libunwind/src/sh/Lcreate_addr_space.c diff --git a/src/sh/Lget_proc_info.c b/libunwind/src/sh/Lget_proc_info.c similarity index 100% rename from src/sh/Lget_proc_info.c rename to libunwind/src/sh/Lget_proc_info.c diff --git a/src/sh/Lget_save_loc.c b/libunwind/src/sh/Lget_save_loc.c similarity index 100% rename from src/sh/Lget_save_loc.c rename to libunwind/src/sh/Lget_save_loc.c diff --git a/src/sh/Lglobal.c b/libunwind/src/sh/Lglobal.c similarity index 100% rename from src/sh/Lglobal.c rename to libunwind/src/sh/Lglobal.c diff --git a/src/sh/Linit.c b/libunwind/src/sh/Linit.c similarity index 100% rename from src/sh/Linit.c rename to libunwind/src/sh/Linit.c diff --git a/src/sh/Linit_local.c b/libunwind/src/sh/Linit_local.c similarity index 100% rename from src/sh/Linit_local.c rename to libunwind/src/sh/Linit_local.c diff --git a/src/sh/Linit_remote.c b/libunwind/src/sh/Linit_remote.c similarity index 100% rename from src/sh/Linit_remote.c rename to libunwind/src/sh/Linit_remote.c diff --git a/src/s390x/Lis_signal_frame.c b/libunwind/src/sh/Lis_signal_frame.c similarity index 100% rename from src/s390x/Lis_signal_frame.c rename to libunwind/src/sh/Lis_signal_frame.c diff --git a/src/s390x/Lreg_states_iterate.c b/libunwind/src/sh/Lreg_states_iterate.c similarity index 100% rename from src/s390x/Lreg_states_iterate.c rename to libunwind/src/sh/Lreg_states_iterate.c diff --git a/src/sh/Lregs.c b/libunwind/src/sh/Lregs.c similarity index 100% rename from src/sh/Lregs.c rename to libunwind/src/sh/Lregs.c diff --git a/src/sh/Lresume.c b/libunwind/src/sh/Lresume.c similarity index 100% rename from src/sh/Lresume.c rename to libunwind/src/sh/Lresume.c diff --git a/src/sh/Lstep.c b/libunwind/src/sh/Lstep.c similarity index 100% rename from src/sh/Lstep.c rename to libunwind/src/sh/Lstep.c diff --git a/src/sh/init.h b/libunwind/src/sh/init.h similarity index 100% rename from src/sh/init.h rename to libunwind/src/sh/init.h diff --git a/src/sh/is_fpreg.c b/libunwind/src/sh/is_fpreg.c similarity index 100% rename from src/sh/is_fpreg.c rename to libunwind/src/sh/is_fpreg.c diff --git a/src/sh/offsets.h b/libunwind/src/sh/offsets.h similarity index 100% rename from src/sh/offsets.h rename to libunwind/src/sh/offsets.h diff --git a/src/sh/regname.c b/libunwind/src/sh/regname.c similarity index 100% rename from src/sh/regname.c rename to libunwind/src/sh/regname.c diff --git a/src/sh/siglongjmp.S b/libunwind/src/sh/siglongjmp.S similarity index 100% rename from src/sh/siglongjmp.S rename to libunwind/src/sh/siglongjmp.S diff --git a/src/sh/unwind_i.h b/libunwind/src/sh/unwind_i.h similarity index 100% rename from src/sh/unwind_i.h rename to libunwind/src/sh/unwind_i.h diff --git a/src/sh/Gapply_reg_state.c b/libunwind/src/tilegx/Gapply_reg_state.c similarity index 100% rename from src/sh/Gapply_reg_state.c rename to libunwind/src/tilegx/Gapply_reg_state.c diff --git a/src/tilegx/Gcreate_addr_space.c b/libunwind/src/tilegx/Gcreate_addr_space.c similarity index 100% rename from src/tilegx/Gcreate_addr_space.c rename to libunwind/src/tilegx/Gcreate_addr_space.c diff --git a/src/tilegx/Gget_proc_info.c b/libunwind/src/tilegx/Gget_proc_info.c similarity index 100% rename from src/tilegx/Gget_proc_info.c rename to libunwind/src/tilegx/Gget_proc_info.c diff --git a/src/tilegx/Gget_save_loc.c b/libunwind/src/tilegx/Gget_save_loc.c similarity index 100% rename from src/tilegx/Gget_save_loc.c rename to libunwind/src/tilegx/Gget_save_loc.c diff --git a/src/tilegx/Gglobal.c b/libunwind/src/tilegx/Gglobal.c similarity index 100% rename from src/tilegx/Gglobal.c rename to libunwind/src/tilegx/Gglobal.c diff --git a/src/tilegx/Ginit.c b/libunwind/src/tilegx/Ginit.c similarity index 100% rename from src/tilegx/Ginit.c rename to libunwind/src/tilegx/Ginit.c diff --git a/src/tilegx/Ginit_local.c b/libunwind/src/tilegx/Ginit_local.c similarity index 100% rename from src/tilegx/Ginit_local.c rename to libunwind/src/tilegx/Ginit_local.c diff --git a/src/tilegx/Ginit_remote.c b/libunwind/src/tilegx/Ginit_remote.c similarity index 100% rename from src/tilegx/Ginit_remote.c rename to libunwind/src/tilegx/Ginit_remote.c diff --git a/src/tilegx/Gis_signal_frame.c b/libunwind/src/tilegx/Gis_signal_frame.c similarity index 97% rename from src/tilegx/Gis_signal_frame.c rename to libunwind/src/tilegx/Gis_signal_frame.c index eea00e47..5452c2cb 100644 --- a/src/tilegx/Gis_signal_frame.c +++ b/libunwind/src/tilegx/Gis_signal_frame.c @@ -96,9 +96,6 @@ tilegx_handle_signal_frame (unw_cursor_t *cursor) C_ABI_SAVE_AREA_SIZE; sc_addr = c->sigcontext_addr + LINUX_UC_MCONTEXT_OFF; - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - /* Update the dwarf cursor. Set the location of the registers to the corresponding addresses of the uc_mcontext / sigcontext structure contents. */ diff --git a/src/sh/Greg_states_iterate.c b/libunwind/src/tilegx/Greg_states_iterate.c similarity index 100% rename from src/sh/Greg_states_iterate.c rename to libunwind/src/tilegx/Greg_states_iterate.c diff --git a/src/tilegx/Gregs.c b/libunwind/src/tilegx/Gregs.c similarity index 100% rename from src/tilegx/Gregs.c rename to libunwind/src/tilegx/Gregs.c diff --git a/src/tilegx/Gresume.c b/libunwind/src/tilegx/Gresume.c similarity index 100% rename from src/tilegx/Gresume.c rename to libunwind/src/tilegx/Gresume.c diff --git a/src/tilegx/Gstep.c b/libunwind/src/tilegx/Gstep.c similarity index 100% rename from src/tilegx/Gstep.c rename to libunwind/src/tilegx/Gstep.c diff --git a/src/sh/Lapply_reg_state.c b/libunwind/src/tilegx/Lapply_reg_state.c similarity index 100% rename from src/sh/Lapply_reg_state.c rename to libunwind/src/tilegx/Lapply_reg_state.c diff --git a/src/tilegx/Lcreate_addr_space.c b/libunwind/src/tilegx/Lcreate_addr_space.c similarity index 100% rename from src/tilegx/Lcreate_addr_space.c rename to libunwind/src/tilegx/Lcreate_addr_space.c diff --git a/src/tilegx/Lget_proc_info.c b/libunwind/src/tilegx/Lget_proc_info.c similarity index 100% rename from src/tilegx/Lget_proc_info.c rename to libunwind/src/tilegx/Lget_proc_info.c diff --git a/src/tilegx/Lget_save_loc.c b/libunwind/src/tilegx/Lget_save_loc.c similarity index 100% rename from src/tilegx/Lget_save_loc.c rename to libunwind/src/tilegx/Lget_save_loc.c diff --git a/src/tilegx/Lglobal.c b/libunwind/src/tilegx/Lglobal.c similarity index 100% rename from src/tilegx/Lglobal.c rename to libunwind/src/tilegx/Lglobal.c diff --git a/src/tilegx/Linit.c b/libunwind/src/tilegx/Linit.c similarity index 100% rename from src/tilegx/Linit.c rename to libunwind/src/tilegx/Linit.c diff --git a/src/tilegx/Linit_local.c b/libunwind/src/tilegx/Linit_local.c similarity index 100% rename from src/tilegx/Linit_local.c rename to libunwind/src/tilegx/Linit_local.c diff --git a/src/tilegx/Linit_remote.c b/libunwind/src/tilegx/Linit_remote.c similarity index 100% rename from src/tilegx/Linit_remote.c rename to libunwind/src/tilegx/Linit_remote.c diff --git a/src/sh/Lis_signal_frame.c b/libunwind/src/tilegx/Lis_signal_frame.c similarity index 100% rename from src/sh/Lis_signal_frame.c rename to libunwind/src/tilegx/Lis_signal_frame.c diff --git a/src/sh/Lreg_states_iterate.c b/libunwind/src/tilegx/Lreg_states_iterate.c similarity index 100% rename from src/sh/Lreg_states_iterate.c rename to libunwind/src/tilegx/Lreg_states_iterate.c diff --git a/src/tilegx/Lregs.c b/libunwind/src/tilegx/Lregs.c similarity index 100% rename from src/tilegx/Lregs.c rename to libunwind/src/tilegx/Lregs.c diff --git a/src/tilegx/Lresume.c b/libunwind/src/tilegx/Lresume.c similarity index 100% rename from src/tilegx/Lresume.c rename to libunwind/src/tilegx/Lresume.c diff --git a/src/tilegx/Lstep.c b/libunwind/src/tilegx/Lstep.c similarity index 100% rename from src/tilegx/Lstep.c rename to libunwind/src/tilegx/Lstep.c diff --git a/src/tilegx/getcontext.S b/libunwind/src/tilegx/getcontext.S similarity index 100% rename from src/tilegx/getcontext.S rename to libunwind/src/tilegx/getcontext.S diff --git a/src/tilegx/init.h b/libunwind/src/tilegx/init.h similarity index 100% rename from src/tilegx/init.h rename to libunwind/src/tilegx/init.h diff --git a/src/tilegx/is_fpreg.c b/libunwind/src/tilegx/is_fpreg.c similarity index 100% rename from src/tilegx/is_fpreg.c rename to libunwind/src/tilegx/is_fpreg.c diff --git a/src/tilegx/offsets.h b/libunwind/src/tilegx/offsets.h similarity index 100% rename from src/tilegx/offsets.h rename to libunwind/src/tilegx/offsets.h diff --git a/src/tilegx/regname.c b/libunwind/src/tilegx/regname.c similarity index 100% rename from src/tilegx/regname.c rename to libunwind/src/tilegx/regname.c diff --git a/src/tilegx/siglongjmp.S b/libunwind/src/tilegx/siglongjmp.S similarity index 100% rename from src/tilegx/siglongjmp.S rename to libunwind/src/tilegx/siglongjmp.S diff --git a/src/tilegx/unwind_i.h b/libunwind/src/tilegx/unwind_i.h similarity index 100% rename from src/tilegx/unwind_i.h rename to libunwind/src/tilegx/unwind_i.h diff --git a/src/unwind/Backtrace.c b/libunwind/src/unwind/Backtrace.c similarity index 100% rename from src/unwind/Backtrace.c rename to libunwind/src/unwind/Backtrace.c diff --git a/src/unwind/DeleteException.c b/libunwind/src/unwind/DeleteException.c similarity index 100% rename from src/unwind/DeleteException.c rename to libunwind/src/unwind/DeleteException.c diff --git a/src/unwind/FindEnclosingFunction.c b/libunwind/src/unwind/FindEnclosingFunction.c similarity index 100% rename from src/unwind/FindEnclosingFunction.c rename to libunwind/src/unwind/FindEnclosingFunction.c diff --git a/src/unwind/ForcedUnwind.c b/libunwind/src/unwind/ForcedUnwind.c similarity index 100% rename from src/unwind/ForcedUnwind.c rename to libunwind/src/unwind/ForcedUnwind.c diff --git a/src/unwind/GetBSP.c b/libunwind/src/unwind/GetBSP.c similarity index 100% rename from src/unwind/GetBSP.c rename to libunwind/src/unwind/GetBSP.c diff --git a/src/unwind/GetCFA.c b/libunwind/src/unwind/GetCFA.c similarity index 100% rename from src/unwind/GetCFA.c rename to libunwind/src/unwind/GetCFA.c diff --git a/src/unwind/GetDataRelBase.c b/libunwind/src/unwind/GetDataRelBase.c similarity index 100% rename from src/unwind/GetDataRelBase.c rename to libunwind/src/unwind/GetDataRelBase.c diff --git a/src/unwind/GetGR.c b/libunwind/src/unwind/GetGR.c similarity index 100% rename from src/unwind/GetGR.c rename to libunwind/src/unwind/GetGR.c diff --git a/src/unwind/GetIP.c b/libunwind/src/unwind/GetIP.c similarity index 100% rename from src/unwind/GetIP.c rename to libunwind/src/unwind/GetIP.c diff --git a/src/unwind/GetIPInfo.c b/libunwind/src/unwind/GetIPInfo.c similarity index 100% rename from src/unwind/GetIPInfo.c rename to libunwind/src/unwind/GetIPInfo.c diff --git a/src/unwind/GetLanguageSpecificData.c b/libunwind/src/unwind/GetLanguageSpecificData.c similarity index 100% rename from src/unwind/GetLanguageSpecificData.c rename to libunwind/src/unwind/GetLanguageSpecificData.c diff --git a/src/unwind/GetRegionStart.c b/libunwind/src/unwind/GetRegionStart.c similarity index 100% rename from src/unwind/GetRegionStart.c rename to libunwind/src/unwind/GetRegionStart.c diff --git a/src/unwind/GetTextRelBase.c b/libunwind/src/unwind/GetTextRelBase.c similarity index 100% rename from src/unwind/GetTextRelBase.c rename to libunwind/src/unwind/GetTextRelBase.c diff --git a/src/unwind/RaiseException.c b/libunwind/src/unwind/RaiseException.c similarity index 100% rename from src/unwind/RaiseException.c rename to libunwind/src/unwind/RaiseException.c diff --git a/src/unwind/Resume.c b/libunwind/src/unwind/Resume.c similarity index 100% rename from src/unwind/Resume.c rename to libunwind/src/unwind/Resume.c diff --git a/src/unwind/Resume_or_Rethrow.c b/libunwind/src/unwind/Resume_or_Rethrow.c similarity index 100% rename from src/unwind/Resume_or_Rethrow.c rename to libunwind/src/unwind/Resume_or_Rethrow.c diff --git a/src/unwind/SetGR.c b/libunwind/src/unwind/SetGR.c similarity index 100% rename from src/unwind/SetGR.c rename to libunwind/src/unwind/SetGR.c diff --git a/src/unwind/SetIP.c b/libunwind/src/unwind/SetIP.c similarity index 100% rename from src/unwind/SetIP.c rename to libunwind/src/unwind/SetIP.c diff --git a/src/unwind/libunwind.pc.in b/libunwind/src/unwind/libunwind.pc.in similarity index 100% rename from src/unwind/libunwind.pc.in rename to libunwind/src/unwind/libunwind.pc.in diff --git a/src/unwind/unwind-internal.h b/libunwind/src/unwind/unwind-internal.h similarity index 100% rename from src/unwind/unwind-internal.h rename to libunwind/src/unwind/unwind-internal.h diff --git a/src/tilegx/Gapply_reg_state.c b/libunwind/src/x86/Gapply_reg_state.c similarity index 100% rename from src/tilegx/Gapply_reg_state.c rename to libunwind/src/x86/Gapply_reg_state.c diff --git a/src/x86/Gcreate_addr_space.c b/libunwind/src/x86/Gcreate_addr_space.c similarity index 100% rename from src/x86/Gcreate_addr_space.c rename to libunwind/src/x86/Gcreate_addr_space.c diff --git a/src/x86/Gget_proc_info.c b/libunwind/src/x86/Gget_proc_info.c similarity index 100% rename from src/x86/Gget_proc_info.c rename to libunwind/src/x86/Gget_proc_info.c diff --git a/src/x86/Gget_save_loc.c b/libunwind/src/x86/Gget_save_loc.c similarity index 100% rename from src/x86/Gget_save_loc.c rename to libunwind/src/x86/Gget_save_loc.c diff --git a/src/x86/Gglobal.c b/libunwind/src/x86/Gglobal.c similarity index 100% rename from src/x86/Gglobal.c rename to libunwind/src/x86/Gglobal.c diff --git a/src/x86/Ginit.c b/libunwind/src/x86/Ginit.c similarity index 92% rename from src/x86/Ginit.c rename to libunwind/src/x86/Ginit.c index 9d3a5943..3cec74a2 100644 --- a/src/x86/Ginit.c +++ b/libunwind/src/x86/Ginit.c @@ -239,20 +239,4 @@ x86_local_addr_space_init (void) unw_flush_cache (&local_addr_space, 0, 0); } -HIDDEN void -init_local_addr_space (unw_addr_space_t as) -{ - memset (as, 0, sizeof (struct unw_addr_space)); - as->caching_policy = UNW_CACHE_GLOBAL; - as->acc.find_proc_info = dwarf_find_proc_info; - as->acc.put_unwind_info = put_unwind_info; - as->acc.get_dyn_info_list_addr = get_dyn_info_list_addr; - as->acc.access_mem = access_mem; - as->acc.access_reg = access_reg; - as->acc.access_fpreg = access_fpreg; - as->acc.resume = x86_local_resume; - as->acc.get_proc_name = get_static_proc_name; - unw_flush_cache (as, 0, 0); -} - #endif /* !UNW_REMOTE_ONLY */ diff --git a/src/x86/Ginit_local.c b/libunwind/src/x86/Ginit_local.c similarity index 88% rename from src/x86/Ginit_local.c rename to libunwind/src/x86/Ginit_local.c index 8074bbd2..0342315d 100644 --- a/src/x86/Ginit_local.c +++ b/libunwind/src/x86/Ginit_local.c @@ -48,23 +48,11 @@ unw_init_local_common(unw_cursor_t *cursor, ucontext_t *uc, unsigned use_prev_in c->dwarf.as = unw_local_addr_space; c->dwarf.as_arg = c; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; c->uc = uc; c->validate = 0; return common_init (c, use_prev_instr); } -int -unw_init_local_with_as(unw_addr_space_t as, unw_cursor_t *cursor, unw_context_t *uc) -{ - int ret = unw_init_local_common(cursor, uc, 1); - struct cursor *c = (struct cursor *) cursor; - c->dwarf.as = as; - return ret; -} - int unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) { diff --git a/src/x86/Ginit_remote.c b/libunwind/src/x86/Ginit_remote.c similarity index 96% rename from src/x86/Ginit_remote.c rename to libunwind/src/x86/Ginit_remote.c index 73f1f87f..18c46624 100644 --- a/src/x86/Ginit_remote.c +++ b/libunwind/src/x86/Ginit_remote.c @@ -41,9 +41,6 @@ unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) c->dwarf.as = as; c->dwarf.as_arg = as_arg; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; if (as == unw_local_addr_space) { c->dwarf.as_arg = c; diff --git a/src/x86/Gos-freebsd.c b/libunwind/src/x86/Gos-freebsd.c similarity index 98% rename from src/x86/Gos-freebsd.c rename to libunwind/src/x86/Gos-freebsd.c index 28e6722a..7dd01404 100644 --- a/src/x86/Gos-freebsd.c +++ b/libunwind/src/x86/Gos-freebsd.c @@ -124,9 +124,6 @@ x86_handle_signal_frame (unw_cursor_t *cursor) return 0; } - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - c->dwarf.loc[EIP] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EIP_OFF, 0); c->dwarf.loc[ESP] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_ESP_OFF, 0); c->dwarf.loc[EAX] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EAX_OFF, 0); @@ -141,7 +138,6 @@ x86_handle_signal_frame (unw_cursor_t *cursor) c->dwarf.loc[ST0] = DWARF_NULL_LOC; } else if (c->sigcontext_format == X86_SCF_FREEBSD_SYSCALL) { c->dwarf.loc[EIP] = DWARF_LOC (c->dwarf.cfa, 0); - c->dwarf.loc[ESP] = DWARF_VAL_LOC (c, c->dwarf.cfa + 4); c->dwarf.loc[EAX] = DWARF_NULL_LOC; c->dwarf.cfa += 4; c->dwarf.use_prev_instr = 1; diff --git a/src/x86/Gos-linux.c b/libunwind/src/x86/Gos-linux.c similarity index 98% rename from src/x86/Gos-linux.c rename to libunwind/src/x86/Gos-linux.c index 0908e3a1..d448dce7 100644 --- a/src/x86/Gos-linux.c +++ b/libunwind/src/x86/Gos-linux.c @@ -73,7 +73,7 @@ HIDDEN int x86_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; - int i, ret; + int ret; /* c->esp points at the arguments to the handler. Without SA_SIGINFO, the arguments consist of a signal number @@ -123,9 +123,6 @@ x86_handle_signal_frame (unw_cursor_t *cursor) return 0; } - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - c->dwarf.loc[EAX] = DWARF_LOC (sc_addr + LINUX_SC_EAX_OFF, 0); c->dwarf.loc[ECX] = DWARF_LOC (sc_addr + LINUX_SC_ECX_OFF, 0); c->dwarf.loc[EDX] = DWARF_LOC (sc_addr + LINUX_SC_EDX_OFF, 0); @@ -133,6 +130,9 @@ x86_handle_signal_frame (unw_cursor_t *cursor) c->dwarf.loc[EBP] = DWARF_LOC (sc_addr + LINUX_SC_EBP_OFF, 0); c->dwarf.loc[ESI] = DWARF_LOC (sc_addr + LINUX_SC_ESI_OFF, 0); c->dwarf.loc[EDI] = DWARF_LOC (sc_addr + LINUX_SC_EDI_OFF, 0); + c->dwarf.loc[EFLAGS] = DWARF_NULL_LOC; + c->dwarf.loc[TRAPNO] = DWARF_NULL_LOC; + c->dwarf.loc[ST0] = DWARF_NULL_LOC; c->dwarf.loc[EIP] = DWARF_LOC (sc_addr + LINUX_SC_EIP_OFF, 0); c->dwarf.loc[ESP] = DWARF_LOC (sc_addr + LINUX_SC_ESP_OFF, 0); diff --git a/src/tilegx/Greg_states_iterate.c b/libunwind/src/x86/Greg_states_iterate.c similarity index 100% rename from src/tilegx/Greg_states_iterate.c rename to libunwind/src/x86/Greg_states_iterate.c diff --git a/src/x86/Gregs.c b/libunwind/src/x86/Gregs.c similarity index 100% rename from src/x86/Gregs.c rename to libunwind/src/x86/Gregs.c diff --git a/src/x86/Gresume.c b/libunwind/src/x86/Gresume.c similarity index 100% rename from src/x86/Gresume.c rename to libunwind/src/x86/Gresume.c diff --git a/src/x86/Gstep.c b/libunwind/src/x86/Gstep.c similarity index 96% rename from src/x86/Gstep.c rename to libunwind/src/x86/Gstep.c index 061dcbaa..129b739a 100644 --- a/src/x86/Gstep.c +++ b/libunwind/src/x86/Gstep.c @@ -47,7 +47,7 @@ unw_step (unw_cursor_t *cursor) { /* DWARF failed, let's see if we can follow the frame-chain or skip over the signal trampoline. */ - struct dwarf_loc ebp_loc, eip_loc, esp_loc; + struct dwarf_loc ebp_loc, eip_loc; /* We could get here because of missing/bad unwind information. Validate all addresses before dereferencing. */ @@ -77,7 +77,6 @@ unw_step (unw_cursor_t *cursor) c->dwarf.cfa); ebp_loc = DWARF_LOC (c->dwarf.cfa, 0); - esp_loc = DWARF_VAL_LOC (c, c->dwarf.cfa + 8); eip_loc = DWARF_LOC (c->dwarf.cfa + 4, 0); c->dwarf.cfa += 8; @@ -88,7 +87,6 @@ unw_step (unw_cursor_t *cursor) c->dwarf.loc[i] = DWARF_NULL_LOC; c->dwarf.loc[EBP] = ebp_loc; - c->dwarf.loc[ESP] = esp_loc; c->dwarf.loc[EIP] = eip_loc; c->dwarf.use_prev_instr = 1; } diff --git a/src/tilegx/Lapply_reg_state.c b/libunwind/src/x86/Lapply_reg_state.c similarity index 100% rename from src/tilegx/Lapply_reg_state.c rename to libunwind/src/x86/Lapply_reg_state.c diff --git a/src/x86/Lcreate_addr_space.c b/libunwind/src/x86/Lcreate_addr_space.c similarity index 100% rename from src/x86/Lcreate_addr_space.c rename to libunwind/src/x86/Lcreate_addr_space.c diff --git a/src/x86/Lget_proc_info.c b/libunwind/src/x86/Lget_proc_info.c similarity index 100% rename from src/x86/Lget_proc_info.c rename to libunwind/src/x86/Lget_proc_info.c diff --git a/src/x86/Lget_save_loc.c b/libunwind/src/x86/Lget_save_loc.c similarity index 100% rename from src/x86/Lget_save_loc.c rename to libunwind/src/x86/Lget_save_loc.c diff --git a/src/x86/Lglobal.c b/libunwind/src/x86/Lglobal.c similarity index 100% rename from src/x86/Lglobal.c rename to libunwind/src/x86/Lglobal.c diff --git a/src/x86/Linit.c b/libunwind/src/x86/Linit.c similarity index 100% rename from src/x86/Linit.c rename to libunwind/src/x86/Linit.c diff --git a/src/x86/Linit_local.c b/libunwind/src/x86/Linit_local.c similarity index 100% rename from src/x86/Linit_local.c rename to libunwind/src/x86/Linit_local.c diff --git a/src/x86/Linit_remote.c b/libunwind/src/x86/Linit_remote.c similarity index 100% rename from src/x86/Linit_remote.c rename to libunwind/src/x86/Linit_remote.c diff --git a/src/x86/Los-freebsd.c b/libunwind/src/x86/Los-freebsd.c similarity index 100% rename from src/x86/Los-freebsd.c rename to libunwind/src/x86/Los-freebsd.c diff --git a/src/x86/Los-linux.c b/libunwind/src/x86/Los-linux.c similarity index 100% rename from src/x86/Los-linux.c rename to libunwind/src/x86/Los-linux.c diff --git a/src/tilegx/Lreg_states_iterate.c b/libunwind/src/x86/Lreg_states_iterate.c similarity index 100% rename from src/tilegx/Lreg_states_iterate.c rename to libunwind/src/x86/Lreg_states_iterate.c diff --git a/src/x86/Lregs.c b/libunwind/src/x86/Lregs.c similarity index 100% rename from src/x86/Lregs.c rename to libunwind/src/x86/Lregs.c diff --git a/src/x86/Lresume.c b/libunwind/src/x86/Lresume.c similarity index 100% rename from src/x86/Lresume.c rename to libunwind/src/x86/Lresume.c diff --git a/src/x86/Lstep.c b/libunwind/src/x86/Lstep.c similarity index 100% rename from src/x86/Lstep.c rename to libunwind/src/x86/Lstep.c diff --git a/src/x86/getcontext-freebsd.S b/libunwind/src/x86/getcontext-freebsd.S similarity index 100% rename from src/x86/getcontext-freebsd.S rename to libunwind/src/x86/getcontext-freebsd.S diff --git a/src/x86/getcontext-linux.S b/libunwind/src/x86/getcontext-linux.S similarity index 100% rename from src/x86/getcontext-linux.S rename to libunwind/src/x86/getcontext-linux.S diff --git a/src/x86/init.h b/libunwind/src/x86/init.h similarity index 100% rename from src/x86/init.h rename to libunwind/src/x86/init.h diff --git a/src/x86/is_fpreg.c b/libunwind/src/x86/is_fpreg.c similarity index 100% rename from src/x86/is_fpreg.c rename to libunwind/src/x86/is_fpreg.c diff --git a/src/x86/longjmp.S b/libunwind/src/x86/longjmp.S similarity index 100% rename from src/x86/longjmp.S rename to libunwind/src/x86/longjmp.S diff --git a/src/x86/offsets.h b/libunwind/src/x86/offsets.h similarity index 100% rename from src/x86/offsets.h rename to libunwind/src/x86/offsets.h diff --git a/src/x86/regname.c b/libunwind/src/x86/regname.c similarity index 100% rename from src/x86/regname.c rename to libunwind/src/x86/regname.c diff --git a/src/x86/siglongjmp.S b/libunwind/src/x86/siglongjmp.S similarity index 100% rename from src/x86/siglongjmp.S rename to libunwind/src/x86/siglongjmp.S diff --git a/src/x86/unwind_i.h b/libunwind/src/x86/unwind_i.h similarity index 97% rename from src/x86/unwind_i.h rename to libunwind/src/x86/unwind_i.h index 452e72d3..caa7e02d 100644 --- a/src/x86/unwind_i.h +++ b/libunwind/src/x86/unwind_i.h @@ -64,6 +64,5 @@ extern void *x86_r_uc_addr (ucontext_t *uc, int reg); extern void x86_sigreturn (unw_cursor_t *cursor); #define x86_handle_signal_frame UNW_OBJ(handle_signal_frame) extern int x86_handle_signal_frame(unw_cursor_t *cursor); -#define init_local_addr_space UNW_OBJ(init_local_addr_space) #endif /* unwind_i_h */ diff --git a/src/x86/Gapply_reg_state.c b/libunwind/src/x86_64/Gapply_reg_state.c similarity index 100% rename from src/x86/Gapply_reg_state.c rename to libunwind/src/x86_64/Gapply_reg_state.c diff --git a/src/x86_64/Gcreate_addr_space.c b/libunwind/src/x86_64/Gcreate_addr_space.c similarity index 100% rename from src/x86_64/Gcreate_addr_space.c rename to libunwind/src/x86_64/Gcreate_addr_space.c diff --git a/src/x86_64/Gget_proc_info.c b/libunwind/src/x86_64/Gget_proc_info.c similarity index 100% rename from src/x86_64/Gget_proc_info.c rename to libunwind/src/x86_64/Gget_proc_info.c diff --git a/src/x86_64/Gget_save_loc.c b/libunwind/src/x86_64/Gget_save_loc.c similarity index 100% rename from src/x86_64/Gget_save_loc.c rename to libunwind/src/x86_64/Gget_save_loc.c diff --git a/src/x86_64/Gglobal.c b/libunwind/src/x86_64/Gglobal.c similarity index 100% rename from src/x86_64/Gglobal.c rename to libunwind/src/x86_64/Gglobal.c diff --git a/src/x86_64/Ginit.c b/libunwind/src/x86_64/Ginit.c similarity index 93% rename from src/x86_64/Ginit.c rename to libunwind/src/x86_64/Ginit.c index d59f35f3..0b121bc9 100644 --- a/src/x86_64/Ginit.c +++ b/libunwind/src/x86_64/Ginit.c @@ -49,13 +49,9 @@ unw_addr_space_t unw_local_addr_space; #else /* !UNW_REMOTE_ONLY */ -#ifndef NO_RESERVE_CACHE static struct unw_addr_space local_addr_space; unw_addr_space_t unw_local_addr_space = &local_addr_space; -#else -unw_addr_space_t unw_local_addr_space; -#endif static void put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) @@ -86,7 +82,7 @@ static int mem_validate_pipe[2] = {-1, -1}; static inline void do_pipe2 (int pipefd[2]) { - int result UNUSED = pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); + pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); } #else static inline void @@ -411,7 +407,6 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, HIDDEN void x86_64_local_addr_space_init (void) { -#ifndef NO_RESERVE_CACHE memset (&local_addr_space, 0, sizeof (local_addr_space)); local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; local_addr_space.acc.find_proc_info = dwarf_find_proc_info; @@ -423,23 +418,6 @@ x86_64_local_addr_space_init (void) local_addr_space.acc.resume = x86_64_local_resume; local_addr_space.acc.get_proc_name = get_static_proc_name; unw_flush_cache (&local_addr_space, 0, 0); -#endif -} - -HIDDEN void -init_local_addr_space (unw_addr_space_t as) -{ - memset (as, 0, sizeof (struct unw_addr_space)); - as->caching_policy = UNW_CACHE_NONE; - as->acc.find_proc_info = dwarf_find_proc_info; - as->acc.put_unwind_info = put_unwind_info; - as->acc.get_dyn_info_list_addr = get_dyn_info_list_addr; - as->acc.access_mem = access_mem; - as->acc.access_reg = access_reg; - as->acc.access_fpreg = access_fpreg; - as->acc.resume = x86_64_local_resume; - as->acc.get_proc_name = get_static_proc_name; - unw_flush_cache (as, 0, 0); } #endif /* !UNW_REMOTE_ONLY */ diff --git a/src/x86_64/Ginit_local.c b/libunwind/src/x86_64/Ginit_local.c similarity index 78% rename from src/x86_64/Ginit_local.c rename to libunwind/src/x86_64/Ginit_local.c index bc107d82..bf771de3 100644 --- a/src/x86_64/Ginit_local.c +++ b/libunwind/src/x86_64/Ginit_local.c @@ -50,32 +50,10 @@ unw_init_local_common (unw_cursor_t *cursor, ucontext_t *uc, unsigned use_prev_i Debug (1, "(cursor=%p)\n", c); c->dwarf.as = unw_local_addr_space; - c->dwarf.as_arg = dwarf_build_as_arg(uc, /*validate*/ 1); - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; + c->dwarf.as_arg = dwarf_build_as_arg(uc, /*validate*/ 0); return common_init (c, use_prev_instr); } -int -unw_init_local_with_as(unw_addr_space_t as, unw_cursor_t *cursor, unw_context_t *uc) -{ - struct cursor *c = (struct cursor *) cursor; - if (unlikely (!atomic_load(&tdep_init_done))) - tdep_init (); - - Debug (1, "(cursor=%p)\n", c); -#ifdef NO_RESERVE_CACHE - unw_local_addr_space = as; -#endif - c->dwarf.as = as; - c->dwarf.as_arg = dwarf_build_as_arg(uc, /*validate*/ 1); - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; - return common_init (c, 1); -} - int unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) { diff --git a/src/x86_64/Ginit_remote.c b/libunwind/src/x86_64/Ginit_remote.c similarity index 96% rename from src/x86_64/Ginit_remote.c rename to libunwind/src/x86_64/Ginit_remote.c index 4cba972c..51761a71 100644 --- a/src/x86_64/Ginit_remote.c +++ b/libunwind/src/x86_64/Ginit_remote.c @@ -43,9 +43,6 @@ unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) Debug (1, "(cursor=%p)\n", c); c->dwarf.as = as; - c->dwarf.cached_map = NULL; - c->dwarf.rel_pc = 0; - c->dwarf.reg_sz = 0; if (as == unw_local_addr_space) { c->dwarf.as_arg = dwarf_build_as_arg(as_arg, /*validate*/ 0); diff --git a/src/x86_64/Gos-freebsd.c b/libunwind/src/x86_64/Gos-freebsd.c similarity index 85% rename from src/x86_64/Gos-freebsd.c rename to libunwind/src/x86_64/Gos-freebsd.c index ee49cf00..91a465c6 100644 --- a/src/x86_64/Gos-freebsd.c +++ b/libunwind/src/x86_64/Gos-freebsd.c @@ -92,7 +92,7 @@ x86_64_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; unw_word_t ucontext; - int i, ret; + int ret; if (c->sigcontext_format == X86_64_SCF_FREEBSD_SIGFRAME) { @@ -108,9 +108,6 @@ x86_64_handle_signal_frame (unw_cursor_t *cursor) return ret; } - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - c->dwarf.loc[RAX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RAX, 0); c->dwarf.loc[RDX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RDX, 0); c->dwarf.loc[RCX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RCX, 0); @@ -136,7 +133,6 @@ x86_64_handle_signal_frame (unw_cursor_t *cursor) c->dwarf.loc[RCX] = c->dwarf.loc[R10]; /* rsp_loc = DWARF_LOC(c->dwarf.cfa - 8, 0); */ /* rbp_loc = c->dwarf.loc[RBP]; */ - c->dwarf.loc[RSP] = DWARF_VAL_LOC (c, c->dwarf.cfa + 8); c->dwarf.loc[RIP] = DWARF_LOC (c->dwarf.cfa, 0); ret = dwarf_get (&c->dwarf, c->dwarf.loc[RIP], &c->dwarf.ip); Debug (1, "Frame Chain [RIP=0x%Lx] = 0x%Lx\n", @@ -196,23 +192,23 @@ x86_64_sigreturn (unw_cursor_t *cursor) ucontext_t *uc = (ucontext_t *)(c->sigcontext_addr + offsetof(struct sigframe, sf_uc)); - uc->uc_mcontext.mc_r8 = c->uc->uc_mcontext.mc_r8; - uc->uc_mcontext.mc_r9 = c->uc->uc_mcontext.mc_r9; - uc->uc_mcontext.mc_r10 = c->uc->uc_mcontext.mc_r10; - uc->uc_mcontext.mc_r11 = c->uc->uc_mcontext.mc_r11; - uc->uc_mcontext.mc_r12 = c->uc->uc_mcontext.mc_r12; - uc->uc_mcontext.mc_r13 = c->uc->uc_mcontext.mc_r13; - uc->uc_mcontext.mc_r14 = c->uc->uc_mcontext.mc_r14; - uc->uc_mcontext.mc_r15 = c->uc->uc_mcontext.mc_r15; - uc->uc_mcontext.mc_rdi = c->uc->uc_mcontext.mc_rdi; - uc->uc_mcontext.mc_rsi = c->uc->uc_mcontext.mc_rsi; - uc->uc_mcontext.mc_rbp = c->uc->uc_mcontext.mc_rbp; - uc->uc_mcontext.mc_rbx = c->uc->uc_mcontext.mc_rbx; - uc->uc_mcontext.mc_rdx = c->uc->uc_mcontext.mc_rdx; - uc->uc_mcontext.mc_rax = c->uc->uc_mcontext.mc_rax; - uc->uc_mcontext.mc_rcx = c->uc->uc_mcontext.mc_rcx; - uc->uc_mcontext.mc_rsp = c->uc->uc_mcontext.mc_rsp; - uc->uc_mcontext.mc_rip = c->uc->uc_mcontext.mc_rip; + uc->uc_mcontext.mc_r8 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r8; + uc->uc_mcontext.mc_r9 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r9; + uc->uc_mcontext.mc_r10 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r10; + uc->uc_mcontext.mc_r11 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r11; + uc->uc_mcontext.mc_r12 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r12; + uc->uc_mcontext.mc_r13 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r13; + uc->uc_mcontext.mc_r14 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r14; + uc->uc_mcontext.mc_r15 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r15; + uc->uc_mcontext.mc_rdi = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rdi; + uc->uc_mcontext.mc_rsi = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rsi; + uc->uc_mcontext.mc_rbp = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rbp; + uc->uc_mcontext.mc_rbx = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rbx; + uc->uc_mcontext.mc_rdx = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rdx; + uc->uc_mcontext.mc_rax = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rax; + uc->uc_mcontext.mc_rcx = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rcx; + uc->uc_mcontext.mc_rsp = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rsp; + uc->uc_mcontext.mc_rip = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rip; Debug (8, "resuming at ip=%llx via sigreturn(%p)\n", (unsigned long long) c->dwarf.ip, uc); diff --git a/src/x86_64/Gos-linux.c b/libunwind/src/x86_64/Gos-linux.c similarity index 100% rename from src/x86_64/Gos-linux.c rename to libunwind/src/x86_64/Gos-linux.c diff --git a/src/x86_64/Gos-solaris.c b/libunwind/src/x86_64/Gos-solaris.c similarity index 98% rename from src/x86_64/Gos-solaris.c rename to libunwind/src/x86_64/Gos-solaris.c index a9957ba8..75258d61 100644 --- a/src/x86_64/Gos-solaris.c +++ b/libunwind/src/x86_64/Gos-solaris.c @@ -51,7 +51,6 @@ x86_64_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; unw_word_t ucontext = c->dwarf.cfa + sizeof (struct sigframe); - int i; if (c->sigcontext_format != X86_64_SCF_SOLARIS_SIGFRAME) return -UNW_EBADFRAME; @@ -70,9 +69,6 @@ x86_64_handle_signal_frame (unw_cursor_t *cursor) return ret; } - for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; - c->dwarf.loc[RAX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RAX, 0); c->dwarf.loc[RDX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RDX, 0); c->dwarf.loc[RCX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RCX, 0); diff --git a/src/x86/Greg_states_iterate.c b/libunwind/src/x86_64/Greg_states_iterate.c similarity index 100% rename from src/x86/Greg_states_iterate.c rename to libunwind/src/x86_64/Greg_states_iterate.c diff --git a/src/x86_64/Gregs.c b/libunwind/src/x86_64/Gregs.c similarity index 100% rename from src/x86_64/Gregs.c rename to libunwind/src/x86_64/Gregs.c diff --git a/src/x86_64/Gresume.c b/libunwind/src/x86_64/Gresume.c similarity index 100% rename from src/x86_64/Gresume.c rename to libunwind/src/x86_64/Gresume.c diff --git a/src/x86_64/Gstash_frame.c b/libunwind/src/x86_64/Gstash_frame.c similarity index 100% rename from src/x86_64/Gstash_frame.c rename to libunwind/src/x86_64/Gstash_frame.c diff --git a/src/x86_64/Gstep.c b/libunwind/src/x86_64/Gstep.c similarity index 97% rename from src/x86_64/Gstep.c rename to libunwind/src/x86_64/Gstep.c index 7a5985c8..3c5c3830 100644 --- a/src/x86_64/Gstep.c +++ b/libunwind/src/x86_64/Gstep.c @@ -112,7 +112,7 @@ unw_step (unw_cursor_t *cursor) unw_word_t invalid_prev_rip = 0; unw_word_t prev_ip = c->dwarf.ip, prev_cfa = c->dwarf.cfa; - struct dwarf_loc rbp_loc = DWARF_NULL_LOC, rsp_loc = DWARF_NULL_LOC, rip_loc = DWARF_NULL_LOC; + struct dwarf_loc rbp_loc, rsp_loc, rip_loc; /* We could get here because of missing/bad unwind information. Validate all addresses before dereferencing. */ @@ -211,7 +211,7 @@ unw_step (unw_cursor_t *cursor) else Debug (2, "new_ip 0x%lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip), ¬_used) != 0\n", new_ip); } - else + else Debug (2, "rsp 0x%lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, rsp), &new_ip) != 0\n", rsp); } /* @@ -223,7 +223,7 @@ unw_step (unw_cursor_t *cursor) Debug (2, "RIP fixup didn't work, falling back\n"); unw_word_t rbp1 = 0; rbp_loc = DWARF_LOC(rbp, 0); - rsp_loc = DWARF_VAL_LOC(c, rbp + 16); + rsp_loc = DWARF_NULL_LOC; rip_loc = DWARF_LOC (rbp + 8, 0); ret = dwarf_get (&c->dwarf, rbp_loc, &rbp1); Debug (1, "[RBP=0x%lx] = 0x%lx (cfa = 0x%lx) -> 0x%lx\n", @@ -253,7 +253,7 @@ unw_step (unw_cursor_t *cursor) } /* Mark all registers unsaved */ for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) - c->dwarf.loc[i] = DWARF_NULL_LOC; + c->dwarf.loc[i] = DWARF_NULL_LOC; c->dwarf.loc[RBP] = rbp_loc; c->dwarf.loc[RSP] = rsp_loc; diff --git a/src/x86_64/Gtrace.c b/libunwind/src/x86_64/Gtrace.c similarity index 100% rename from src/x86_64/Gtrace.c rename to libunwind/src/x86_64/Gtrace.c diff --git a/src/x86/Lapply_reg_state.c b/libunwind/src/x86_64/Lapply_reg_state.c similarity index 100% rename from src/x86/Lapply_reg_state.c rename to libunwind/src/x86_64/Lapply_reg_state.c diff --git a/src/x86_64/Lcreate_addr_space.c b/libunwind/src/x86_64/Lcreate_addr_space.c similarity index 100% rename from src/x86_64/Lcreate_addr_space.c rename to libunwind/src/x86_64/Lcreate_addr_space.c diff --git a/src/x86_64/Lget_proc_info.c b/libunwind/src/x86_64/Lget_proc_info.c similarity index 100% rename from src/x86_64/Lget_proc_info.c rename to libunwind/src/x86_64/Lget_proc_info.c diff --git a/src/x86_64/Lget_save_loc.c b/libunwind/src/x86_64/Lget_save_loc.c similarity index 100% rename from src/x86_64/Lget_save_loc.c rename to libunwind/src/x86_64/Lget_save_loc.c diff --git a/src/x86_64/Lglobal.c b/libunwind/src/x86_64/Lglobal.c similarity index 100% rename from src/x86_64/Lglobal.c rename to libunwind/src/x86_64/Lglobal.c diff --git a/src/x86_64/Linit.c b/libunwind/src/x86_64/Linit.c similarity index 100% rename from src/x86_64/Linit.c rename to libunwind/src/x86_64/Linit.c diff --git a/src/x86_64/Linit_local.c b/libunwind/src/x86_64/Linit_local.c similarity index 100% rename from src/x86_64/Linit_local.c rename to libunwind/src/x86_64/Linit_local.c diff --git a/src/x86_64/Linit_remote.c b/libunwind/src/x86_64/Linit_remote.c similarity index 100% rename from src/x86_64/Linit_remote.c rename to libunwind/src/x86_64/Linit_remote.c diff --git a/src/x86_64/Los-freebsd.c b/libunwind/src/x86_64/Los-freebsd.c similarity index 100% rename from src/x86_64/Los-freebsd.c rename to libunwind/src/x86_64/Los-freebsd.c diff --git a/src/x86_64/Los-linux.c b/libunwind/src/x86_64/Los-linux.c similarity index 100% rename from src/x86_64/Los-linux.c rename to libunwind/src/x86_64/Los-linux.c diff --git a/src/x86_64/Los-solaris.c b/libunwind/src/x86_64/Los-solaris.c similarity index 100% rename from src/x86_64/Los-solaris.c rename to libunwind/src/x86_64/Los-solaris.c diff --git a/src/x86/Lreg_states_iterate.c b/libunwind/src/x86_64/Lreg_states_iterate.c similarity index 100% rename from src/x86/Lreg_states_iterate.c rename to libunwind/src/x86_64/Lreg_states_iterate.c diff --git a/src/x86_64/Lregs.c b/libunwind/src/x86_64/Lregs.c similarity index 100% rename from src/x86_64/Lregs.c rename to libunwind/src/x86_64/Lregs.c diff --git a/src/x86_64/Lresume.c b/libunwind/src/x86_64/Lresume.c similarity index 100% rename from src/x86_64/Lresume.c rename to libunwind/src/x86_64/Lresume.c diff --git a/src/x86_64/Lstash_frame.c b/libunwind/src/x86_64/Lstash_frame.c similarity index 100% rename from src/x86_64/Lstash_frame.c rename to libunwind/src/x86_64/Lstash_frame.c diff --git a/src/x86_64/Lstep.c b/libunwind/src/x86_64/Lstep.c similarity index 100% rename from src/x86_64/Lstep.c rename to libunwind/src/x86_64/Lstep.c diff --git a/src/x86_64/Ltrace.c b/libunwind/src/x86_64/Ltrace.c similarity index 100% rename from src/x86_64/Ltrace.c rename to libunwind/src/x86_64/Ltrace.c diff --git a/src/x86_64/getcontext.S b/libunwind/src/x86_64/getcontext.S similarity index 100% rename from src/x86_64/getcontext.S rename to libunwind/src/x86_64/getcontext.S diff --git a/src/x86_64/init.h b/libunwind/src/x86_64/init.h similarity index 100% rename from src/x86_64/init.h rename to libunwind/src/x86_64/init.h diff --git a/src/x86_64/is_fpreg.c b/libunwind/src/x86_64/is_fpreg.c similarity index 100% rename from src/x86_64/is_fpreg.c rename to libunwind/src/x86_64/is_fpreg.c diff --git a/src/x86_64/longjmp.S b/libunwind/src/x86_64/longjmp.S similarity index 100% rename from src/x86_64/longjmp.S rename to libunwind/src/x86_64/longjmp.S diff --git a/src/x86_64/offsets.h b/libunwind/src/x86_64/offsets.h similarity index 100% rename from src/x86_64/offsets.h rename to libunwind/src/x86_64/offsets.h diff --git a/src/x86_64/regname.c b/libunwind/src/x86_64/regname.c similarity index 100% rename from src/x86_64/regname.c rename to libunwind/src/x86_64/regname.c diff --git a/src/x86_64/setcontext.S b/libunwind/src/x86_64/setcontext.S similarity index 100% rename from src/x86_64/setcontext.S rename to libunwind/src/x86_64/setcontext.S diff --git a/src/x86_64/siglongjmp.S b/libunwind/src/x86_64/siglongjmp.S similarity index 100% rename from src/x86_64/siglongjmp.S rename to libunwind/src/x86_64/siglongjmp.S diff --git a/src/x86_64/ucontext_i.h b/libunwind/src/x86_64/ucontext_i.h similarity index 98% rename from src/x86_64/ucontext_i.h rename to libunwind/src/x86_64/ucontext_i.h index 04bec5ba..e886c948 100644 --- a/src/x86_64/ucontext_i.h +++ b/libunwind/src/x86_64/ucontext_i.h @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if defined __linux__ || defined(UNW_TARGET_X86_64_LINUX) +#if defined __linux__ #define UC_MCONTEXT_GREGS_R8 0x28 #define UC_MCONTEXT_GREGS_R9 0x30 #define UC_MCONTEXT_GREGS_R10 0x38 diff --git a/src/x86_64/unwind_i.h b/libunwind/src/x86_64/unwind_i.h similarity index 97% rename from src/x86_64/unwind_i.h rename to libunwind/src/x86_64/unwind_i.h index c3e75408..49fa078f 100644 --- a/src/x86_64/unwind_i.h +++ b/libunwind/src/x86_64/unwind_i.h @@ -63,6 +63,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endif #define x86_64_r_uc_addr UNW_OBJ(r_uc_addr) #define x86_64_sigreturn UNW_OBJ(sigreturn) + /* By-pass calls to access_mem() when known to be safe. */ #ifdef UNW_LOCAL_ONLY # undef ACCESS_MEM_FAST @@ -88,6 +89,5 @@ extern void *x86_64_r_uc_addr (ucontext_t *uc, int reg); extern NORETURN void x86_64_sigreturn (unw_cursor_t *cursor); #define x86_64_handle_signal_frame UNW_OBJ(handle_signal_frame) extern int x86_64_handle_signal_frame(unw_cursor_t *cursor); -#define init_local_addr_space UNW_OBJ(init_local_addr_space) #endif /* unwind_i_h */ diff --git a/tests/Gia64-test-nat.c b/libunwind/tests/Gia64-test-nat.c similarity index 100% rename from tests/Gia64-test-nat.c rename to libunwind/tests/Gia64-test-nat.c diff --git a/tests/Gia64-test-rbs.c b/libunwind/tests/Gia64-test-rbs.c similarity index 100% rename from tests/Gia64-test-rbs.c rename to libunwind/tests/Gia64-test-rbs.c diff --git a/tests/Gia64-test-readonly.c b/libunwind/tests/Gia64-test-readonly.c similarity index 100% rename from tests/Gia64-test-readonly.c rename to libunwind/tests/Gia64-test-readonly.c diff --git a/tests/Gia64-test-stack.c b/libunwind/tests/Gia64-test-stack.c similarity index 100% rename from tests/Gia64-test-stack.c rename to libunwind/tests/Gia64-test-stack.c diff --git a/tests/Gperf-simple.c b/libunwind/tests/Gperf-simple.c similarity index 100% rename from tests/Gperf-simple.c rename to libunwind/tests/Gperf-simple.c diff --git a/tests/Gperf-trace.c b/libunwind/tests/Gperf-trace.c similarity index 100% rename from tests/Gperf-trace.c rename to libunwind/tests/Gperf-trace.c diff --git a/tests/Gtest-bt.c b/libunwind/tests/Gtest-bt.c similarity index 100% rename from tests/Gtest-bt.c rename to libunwind/tests/Gtest-bt.c diff --git a/tests/Gtest-concurrent.c b/libunwind/tests/Gtest-concurrent.c similarity index 100% rename from tests/Gtest-concurrent.c rename to libunwind/tests/Gtest-concurrent.c diff --git a/tests/Gtest-dyn1.c b/libunwind/tests/Gtest-dyn1.c similarity index 100% rename from tests/Gtest-dyn1.c rename to libunwind/tests/Gtest-dyn1.c diff --git a/tests/Gtest-exc.c b/libunwind/tests/Gtest-exc.c similarity index 100% rename from tests/Gtest-exc.c rename to libunwind/tests/Gtest-exc.c diff --git a/tests/Gtest-init.cxx b/libunwind/tests/Gtest-init.cxx similarity index 100% rename from tests/Gtest-init.cxx rename to libunwind/tests/Gtest-init.cxx diff --git a/tests/Gtest-nomalloc.c b/libunwind/tests/Gtest-nomalloc.c similarity index 100% rename from tests/Gtest-nomalloc.c rename to libunwind/tests/Gtest-nomalloc.c diff --git a/tests/Gtest-resume-sig-rt.c b/libunwind/tests/Gtest-resume-sig-rt.c similarity index 100% rename from tests/Gtest-resume-sig-rt.c rename to libunwind/tests/Gtest-resume-sig-rt.c diff --git a/tests/Gtest-resume-sig.c b/libunwind/tests/Gtest-resume-sig.c similarity index 100% rename from tests/Gtest-resume-sig.c rename to libunwind/tests/Gtest-resume-sig.c diff --git a/tests/Gtest-trace.c b/libunwind/tests/Gtest-trace.c similarity index 100% rename from tests/Gtest-trace.c rename to libunwind/tests/Gtest-trace.c diff --git a/tests/Gx64-test-dwarf-expressions.c b/libunwind/tests/Gx64-test-dwarf-expressions.c similarity index 100% rename from tests/Gx64-test-dwarf-expressions.c rename to libunwind/tests/Gx64-test-dwarf-expressions.c diff --git a/tests/Lia64-test-nat.c b/libunwind/tests/Lia64-test-nat.c similarity index 100% rename from tests/Lia64-test-nat.c rename to libunwind/tests/Lia64-test-nat.c diff --git a/tests/Lia64-test-rbs.c b/libunwind/tests/Lia64-test-rbs.c similarity index 100% rename from tests/Lia64-test-rbs.c rename to libunwind/tests/Lia64-test-rbs.c diff --git a/tests/Lia64-test-readonly.c b/libunwind/tests/Lia64-test-readonly.c similarity index 100% rename from tests/Lia64-test-readonly.c rename to libunwind/tests/Lia64-test-readonly.c diff --git a/tests/Lia64-test-stack.c b/libunwind/tests/Lia64-test-stack.c similarity index 100% rename from tests/Lia64-test-stack.c rename to libunwind/tests/Lia64-test-stack.c diff --git a/tests/Lperf-simple.c b/libunwind/tests/Lperf-simple.c similarity index 100% rename from tests/Lperf-simple.c rename to libunwind/tests/Lperf-simple.c diff --git a/tests/Lperf-trace.c b/libunwind/tests/Lperf-trace.c similarity index 100% rename from tests/Lperf-trace.c rename to libunwind/tests/Lperf-trace.c diff --git a/tests/Lrs-race.c b/libunwind/tests/Lrs-race.c similarity index 100% rename from tests/Lrs-race.c rename to libunwind/tests/Lrs-race.c diff --git a/tests/Ltest-bt.c b/libunwind/tests/Ltest-bt.c similarity index 100% rename from tests/Ltest-bt.c rename to libunwind/tests/Ltest-bt.c diff --git a/tests/Ltest-concurrent.c b/libunwind/tests/Ltest-concurrent.c similarity index 100% rename from tests/Ltest-concurrent.c rename to libunwind/tests/Ltest-concurrent.c diff --git a/tests/Ltest-cxx-exceptions.cxx b/libunwind/tests/Ltest-cxx-exceptions.cxx similarity index 100% rename from tests/Ltest-cxx-exceptions.cxx rename to libunwind/tests/Ltest-cxx-exceptions.cxx diff --git a/tests/Ltest-dyn1.c b/libunwind/tests/Ltest-dyn1.c similarity index 100% rename from tests/Ltest-dyn1.c rename to libunwind/tests/Ltest-dyn1.c diff --git a/tests/Ltest-exc.c b/libunwind/tests/Ltest-exc.c similarity index 100% rename from tests/Ltest-exc.c rename to libunwind/tests/Ltest-exc.c diff --git a/tests/Ltest-init-local-signal-lib.c b/libunwind/tests/Ltest-init-local-signal-lib.c similarity index 100% rename from tests/Ltest-init-local-signal-lib.c rename to libunwind/tests/Ltest-init-local-signal-lib.c diff --git a/tests/Ltest-init-local-signal.c b/libunwind/tests/Ltest-init-local-signal.c similarity index 100% rename from tests/Ltest-init-local-signal.c rename to libunwind/tests/Ltest-init-local-signal.c diff --git a/tests/Ltest-init.cxx b/libunwind/tests/Ltest-init.cxx similarity index 100% rename from tests/Ltest-init.cxx rename to libunwind/tests/Ltest-init.cxx diff --git a/tests/Ltest-mem-validate.c b/libunwind/tests/Ltest-mem-validate.c similarity index 97% rename from tests/Ltest-mem-validate.c rename to libunwind/tests/Ltest-mem-validate.c index d31935c4..251c34ea 100644 --- a/tests/Ltest-mem-validate.c +++ b/libunwind/tests/Ltest-mem-validate.c @@ -71,7 +71,7 @@ void do_backtrace (void) unw_get_reg (&cursor, UNW_REG_SP, &sp); ret = unw_step (&cursor); - printf("ip=%lx, sp=%lx -> %d\n", (unsigned long)ip, (unsigned long)sp, ret); + printf("ip=%lx, sp=%lx -> %d\n", ip, sp, ret); if (ret < 0) { unw_get_reg (&cursor, UNW_REG_IP, &ip); diff --git a/tests/Ltest-nocalloc.c b/libunwind/tests/Ltest-nocalloc.c similarity index 100% rename from tests/Ltest-nocalloc.c rename to libunwind/tests/Ltest-nocalloc.c diff --git a/tests/Ltest-nomalloc.c b/libunwind/tests/Ltest-nomalloc.c similarity index 100% rename from tests/Ltest-nomalloc.c rename to libunwind/tests/Ltest-nomalloc.c diff --git a/tests/Ltest-resume-sig-rt.c b/libunwind/tests/Ltest-resume-sig-rt.c similarity index 100% rename from tests/Ltest-resume-sig-rt.c rename to libunwind/tests/Ltest-resume-sig-rt.c diff --git a/tests/Ltest-resume-sig.c b/libunwind/tests/Ltest-resume-sig.c similarity index 100% rename from tests/Ltest-resume-sig.c rename to libunwind/tests/Ltest-resume-sig.c diff --git a/tests/Ltest-trace.c b/libunwind/tests/Ltest-trace.c similarity index 100% rename from tests/Ltest-trace.c rename to libunwind/tests/Ltest-trace.c diff --git a/tests/Ltest-varargs.c b/libunwind/tests/Ltest-varargs.c similarity index 100% rename from tests/Ltest-varargs.c rename to libunwind/tests/Ltest-varargs.c diff --git a/tests/Lx64-test-dwarf-expressions.c b/libunwind/tests/Lx64-test-dwarf-expressions.c similarity index 100% rename from tests/Lx64-test-dwarf-expressions.c rename to libunwind/tests/Lx64-test-dwarf-expressions.c diff --git a/tests/Makefile.am b/libunwind/tests/Makefile.am similarity index 100% rename from tests/Makefile.am rename to libunwind/tests/Makefile.am diff --git a/libunwind/tests/check-namespace.sh b/libunwind/tests/check-namespace.sh new file mode 100644 index 00000000..7d75f25e --- /dev/null +++ b/libunwind/tests/check-namespace.sh @@ -0,0 +1,402 @@ +#!/bin/sh +verbose=false +if [ "$1" = "-v" ]; then + verbose=true + shift +fi + +build_plat=x86_64 +plat=x86_64 +os=linux-gnu +num_errors=0 + +LIBUNWIND=../src/.libs/libunwind.so +LIBUNWIND_GENERIC=../src/.libs/libunwind-${plat}.so + +fetch_symtab () { + filename=$1 + + if [ ! -r $filename ]; then + return + fi + + if $verbose; then + echo "Checking $filename..." + fi + + # + # Unfortunately, "nm --defined" is a GNU-extension. For portability, + # build the list of defined symbols by hand. + # + symtab=`nm -g $filename` + saved_IFS="$IFS" + IFS="" + undef=`nm -g -u $filename` + for line in $undef; do + symtab=`echo "$symtab" | grep -v "^${line}"\$` + done; + IFS="$saved_IFS" +} + +ignore () { + sym=$1 + symtab=`echo "$symtab" | grep -v " ${sym}\$"` +} + +match () { + sym=$1 + if `echo "$symtab" | grep -q " ${sym}\$"`; then + symtab=`echo "$symtab" | grep -v " ${sym}\$"` + else + echo " ERROR: Symbol \"$sym\" missing." + num_errors=`expr $num_errors + 1` + fi +} + +# +# Filter out miscellaneous symbols that get defined by the +# linker for each shared object. +# +filter_misc () { + ignore _DYNAMIC + ignore _GLOBAL_OFFSET_TABLE_ + ignore __bss_start + ignore _edata + ignore _end + ignore _Uelf32_get_proc_name + ignore _Uelf32_valid_object + ignore _Uelf64_get_proc_name + ignore _Uelf64_valid_object + ignore _U.*debug_level + ignore ICRT.INTERNAL # ICC 8.x defines this + + # Ignore symbols generated by the ARM Linux default linker script. + # For details see the binutils sources (src/ld/emulparams/armelf_linux.sh). + if [ ${plat} = "arm" ]; then + ignore __bss_start__ + ignore __bss_end__ + ignore __end__ + ignore _bss_end__ + fi + + if [ ${plat} = "mips" ]; then + ignore _fbss + ignore _fdata + ignore _ftext + ignore _gp + fi + + if [ ${os} == "solaris2.11" ]; then + ignore _PROCEDURE_LINKAGE_TABLE_ + ignore _etext + fi +} + +check_local_unw_abi () { + match _UL${plat}_apply_reg_state + match _UL${plat}_reg_states_iterate + match _UL${plat}_create_addr_space + match _UL${plat}_destroy_addr_space + match _UL${plat}_get_fpreg + match _UL${plat}_get_proc_info + match _UL${plat}_get_proc_info_by_ip + match _UL${plat}_get_proc_name + match _UL${plat}_get_reg + match _UL${plat}_get_save_loc + match _UL${plat}_init_local + match _UL${plat}_init_local2 + match _UL${plat}_init_remote + match _UL${plat}_is_signal_frame + match _UL${plat}_local_addr_space + match _UL${plat}_resume + match _UL${plat}_set_caching_policy + match _UL${plat}_set_cache_size + match _UL${plat}_set_reg + match _UL${plat}_set_fpreg + match _UL${plat}_step + + match _U${plat}_flush_cache + match _U${plat}_get_accessors + match _U${plat}_getcontext + match _U${plat}_regname + match _U${plat}_strerror + + match _U_dyn_cancel + match _U_dyn_info_list_addr + match _U_dyn_register + + match unw_backtrace + match backtrace + + case ${plat} in + arm) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _UL${plat}_search_unwind_table + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + ;; + hppa) + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_setcontext + ;; + ia64) + match _UL${plat}_search_unwind_table + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + ;; + x86) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + ;; + x86_64) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + match _U${plat}_setcontext + ;; + ppc*) + match _U${plat}_get_func_addr + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + ;; + tilegx) + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + match _UL${plat}_local_addr_space_init + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match ${plat}_lock + ;; + s390x) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + match _U${plat}_setcontext + ;; + riscv) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + match _U${plat}_setcontext + ;; + + *) + match _U${plat}_is_fpreg + match _UL${plat}_dwarf_search_unwind_table + match _UL${plat}_dwarf_find_unwind_table + ;; + esac + + if [ xno = xyes ]; then + match _UL${plat}_dwarf_find_debug_frame + fi + +} + +check_generic_unw_abi () { + match _U${plat}_apply_reg_state + match _U${plat}_reg_states_iterate + match _U${plat}_create_addr_space + match _U${plat}_destroy_addr_space + match _U${plat}_flush_cache + match _U${plat}_get_accessors + match _U${plat}_get_fpreg + match _U${plat}_get_proc_info + match _U${plat}_get_proc_info_by_ip + match _U${plat}_get_proc_name + match _U${plat}_get_reg + match _U${plat}_get_save_loc + match _U${plat}_init_local + match _U${plat}_init_local2 + match _U${plat}_init_remote + match _U${plat}_is_signal_frame + match _U${plat}_local_addr_space + match _U${plat}_regname + match _U${plat}_resume + match _U${plat}_set_caching_policy + match _U${plat}_set_cache_size + match _U${plat}_set_fpreg + match _U${plat}_set_reg + match _U${plat}_step + match _U${plat}_strerror + + case ${plat} in + arm) + match _U${plat}_is_fpreg + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_search_unwind_table + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + hppa) + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + ;; + ia64) + match _U${plat}_search_unwind_table + match _U${plat}_find_dyn_list + if [ $plat = $build_plat ]; then + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + case $os in + linux*) + match _U${plat}_get_kernel_table + ;; + esac + fi + ;; + x86) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + x86_64) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + ppc*) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_get_func_addr + match _U${plat}_is_fpreg + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + tilegx) + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _U${plat}_local_addr_space_init + match ${plat}_lock + ;; + s390x) + match _U${plat}_is_fpreg + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + riscv) + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path + match _U${plat}_is_fpreg + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + *) + match _U${plat}_is_fpreg + match _U${plat}_dwarf_search_unwind_table + match _U${plat}_dwarf_find_unwind_table + ;; + esac + + if [ xno = xyes ]; then + match _U${plat}_dwarf_find_debug_frame + fi +} + +check_cxx_abi () { + match _Unwind_Backtrace + match _Unwind_DeleteException + match _Unwind_FindEnclosingFunction + match _Unwind_ForcedUnwind + match _Unwind_GetBSP + match _Unwind_GetCFA + match _Unwind_GetDataRelBase + match _Unwind_GetGR + match _Unwind_GetIP + match _Unwind_GetIPInfo + match _Unwind_GetLanguageSpecificData + match _Unwind_GetRegionStart + match _Unwind_GetTextRelBase + match _Unwind_RaiseException + match _Unwind_Resume + match _Unwind_Resume_or_Rethrow + match _Unwind_SetGR + match _Unwind_SetIP + match __libunwind_Unwind_Backtrace + match __libunwind_Unwind_DeleteException + match __libunwind_Unwind_FindEnclosingFunction + match __libunwind_Unwind_ForcedUnwind + match __libunwind_Unwind_GetBSP + match __libunwind_Unwind_GetCFA + match __libunwind_Unwind_GetDataRelBase + match __libunwind_Unwind_GetGR + match __libunwind_Unwind_GetIP + match __libunwind_Unwind_GetIPInfo + match __libunwind_Unwind_GetLanguageSpecificData + match __libunwind_Unwind_GetRegionStart + match __libunwind_Unwind_GetTextRelBase + match __libunwind_Unwind_RaiseException + match __libunwind_Unwind_Resume + match __libunwind_Unwind_Resume_or_Rethrow + match __libunwind_Unwind_SetGR + match __libunwind_Unwind_SetIP + case $os in + linux*) + # needed only for Intel 8.0 bug-compatibility + match _ReadSLEB + match _ReadULEB + ;; + esac +} + +check_empty () { + if [ -n "$symtab" ]; then + printf " ERROR: Extraneous symbols:\n$symtab\n" + num_errors=`expr $num_errors + 1` + fi +} + +if [ $plat = $build_plat ]; then + fetch_symtab $LIBUNWIND + filter_misc + check_local_unw_abi + if [ xno = xyes ]; then + check_cxx_abi + fi + check_empty +fi + +fetch_symtab $LIBUNWIND_GENERIC +filter_misc +check_generic_unw_abi +check_empty + +if [ $num_errors -gt 0 ]; then + echo "FAILURE: Detected $num_errors errors" + exit 1 +fi + +if $verbose; then + echo " SUCCESS: all checks passed" +fi +exit 0 diff --git a/tests/check-namespace.sh.in b/libunwind/tests/check-namespace.sh.in similarity index 92% rename from tests/check-namespace.sh.in rename to libunwind/tests/check-namespace.sh.in index f99fb59f..f9201a2d 100644 --- a/tests/check-namespace.sh.in +++ b/libunwind/tests/check-namespace.sh.in @@ -117,7 +117,8 @@ check_local_unw_abi () { match _U${plat}_flush_cache match _U${plat}_get_accessors - match _U${plat}_getcontext + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path match _U${plat}_regname match _U${plat}_strerror @@ -130,68 +131,59 @@ check_local_unw_abi () { case ${plat} in arm) - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path + match _U${plat}_getcontext match _U${plat}_is_fpreg match _UL${plat}_search_unwind_table match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table ;; hppa) + match _U${plat}_getcontext match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path match _U${plat}_setcontext ;; ia64) + match _U${plat}_getcontext match _UL${plat}_search_unwind_table - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path ;; x86) - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path + match _U${plat}_getcontext match _U${plat}_is_fpreg match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table ;; x86_64) - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path + match _U${plat}_getcontext match _U${plat}_is_fpreg match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table match _U${plat}_setcontext ;; ppc*) + match _U${plat}_getcontext match _U${plat}_get_func_addr - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path match _U${plat}_is_fpreg match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table ;; tilegx) + match _U${plat}_getcontext match _U${plat}_is_fpreg match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table match _UL${plat}_local_addr_space_init - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path match ${plat}_lock ;; s390x) - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path + match _U${plat}_getcontext match _U${plat}_is_fpreg match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table match _U${plat}_setcontext ;; riscv) - match _U${plat}_get_elf_image - match _U${plat}_get_exe_image_path + match _U${plat}_getcontext match _U${plat}_is_fpreg match _UL${plat}_dwarf_search_unwind_table match _UL${plat}_dwarf_find_unwind_table @@ -288,15 +280,15 @@ check_generic_unw_abi () { match _U${plat}_dwarf_search_unwind_table match _U${plat}_dwarf_find_unwind_table ;; - tilegx) - match _U${plat}_dwarf_search_unwind_table + tilegx) + match _U${plat}_dwarf_search_unwind_table match _U${plat}_dwarf_find_unwind_table - match _U${plat}_get_elf_image + match _U${plat}_get_elf_image match _U${plat}_get_exe_image_path - match _U${plat}_is_fpreg - match _U${plat}_local_addr_space_init - match ${plat}_lock - ;; + match _U${plat}_is_fpreg + match _U${plat}_local_addr_space_init + match ${plat}_lock + ;; s390x) match _U${plat}_is_fpreg match _U${plat}_get_elf_image @@ -315,6 +307,8 @@ check_generic_unw_abi () { match _U${plat}_is_fpreg match _U${plat}_dwarf_search_unwind_table match _U${plat}_dwarf_find_unwind_table + match _U${plat}_get_elf_image + match _U${plat}_get_exe_image_path ;; esac diff --git a/tests/crasher.c b/libunwind/tests/crasher.c similarity index 100% rename from tests/crasher.c rename to libunwind/tests/crasher.c diff --git a/tests/flush-cache.S b/libunwind/tests/flush-cache.S similarity index 100% rename from tests/flush-cache.S rename to libunwind/tests/flush-cache.S diff --git a/tests/flush-cache.h b/libunwind/tests/flush-cache.h similarity index 100% rename from tests/flush-cache.h rename to libunwind/tests/flush-cache.h diff --git a/tests/forker.c b/libunwind/tests/forker.c similarity index 100% rename from tests/forker.c rename to libunwind/tests/forker.c diff --git a/tests/ia64-dyn-asm.S b/libunwind/tests/ia64-dyn-asm.S similarity index 100% rename from tests/ia64-dyn-asm.S rename to libunwind/tests/ia64-dyn-asm.S diff --git a/tests/ia64-test-dyn1.c b/libunwind/tests/ia64-test-dyn1.c similarity index 100% rename from tests/ia64-test-dyn1.c rename to libunwind/tests/ia64-test-dyn1.c diff --git a/tests/ia64-test-nat-asm.S b/libunwind/tests/ia64-test-nat-asm.S similarity index 100% rename from tests/ia64-test-nat-asm.S rename to libunwind/tests/ia64-test-nat-asm.S diff --git a/tests/ia64-test-rbs-asm.S b/libunwind/tests/ia64-test-rbs-asm.S similarity index 100% rename from tests/ia64-test-rbs-asm.S rename to libunwind/tests/ia64-test-rbs-asm.S diff --git a/tests/ia64-test-rbs.h b/libunwind/tests/ia64-test-rbs.h similarity index 100% rename from tests/ia64-test-rbs.h rename to libunwind/tests/ia64-test-rbs.h diff --git a/tests/ia64-test-readonly-asm.S b/libunwind/tests/ia64-test-readonly-asm.S similarity index 100% rename from tests/ia64-test-readonly-asm.S rename to libunwind/tests/ia64-test-readonly-asm.S diff --git a/tests/ia64-test-setjmp.c b/libunwind/tests/ia64-test-setjmp.c similarity index 100% rename from tests/ia64-test-setjmp.c rename to libunwind/tests/ia64-test-setjmp.c diff --git a/tests/ia64-test-sig.c b/libunwind/tests/ia64-test-sig.c similarity index 100% rename from tests/ia64-test-sig.c rename to libunwind/tests/ia64-test-sig.c diff --git a/tests/ia64-test-stack-asm.S b/libunwind/tests/ia64-test-stack-asm.S similarity index 100% rename from tests/ia64-test-stack-asm.S rename to libunwind/tests/ia64-test-stack-asm.S diff --git a/tests/ia64-test-stack.h b/libunwind/tests/ia64-test-stack.h similarity index 100% rename from tests/ia64-test-stack.h rename to libunwind/tests/ia64-test-stack.h diff --git a/tests/ident.c b/libunwind/tests/ident.c similarity index 100% rename from tests/ident.c rename to libunwind/tests/ident.c diff --git a/tests/mapper.c b/libunwind/tests/mapper.c similarity index 93% rename from tests/mapper.c rename to libunwind/tests/mapper.c index b47ae780..fcfb0807 100644 --- a/tests/mapper.c +++ b/libunwind/tests/mapper.c @@ -43,6 +43,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define MAP_NORESERVE 0 #endif +void __attribute__((noinline)) push_some_stacks(int n) +{ + if (n >= 1) + { + push_some_stacks(n - 1); + push_some_stacks(n - 1); + } +} + int main (void) { @@ -71,7 +80,7 @@ main (void) printf ("Turning on single-stepping...\n"); kill (getpid (), SIGUSR1); /* tell test-ptrace to start single-stepping */ - printf ("Va bene?\n"); + push_some_stacks (4); kill (getpid (), SIGUSR2); /* tell test-ptrace to stop single-stepping */ printf ("Turned single-stepping off...\n"); return 0; diff --git a/tests/ppc64-test-altivec-utils.c b/libunwind/tests/ppc64-test-altivec-utils.c similarity index 100% rename from tests/ppc64-test-altivec-utils.c rename to libunwind/tests/ppc64-test-altivec-utils.c diff --git a/tests/ppc64-test-altivec.c b/libunwind/tests/ppc64-test-altivec.c similarity index 100% rename from tests/ppc64-test-altivec.c rename to libunwind/tests/ppc64-test-altivec.c diff --git a/tests/run-check-namespace b/libunwind/tests/run-check-namespace similarity index 100% rename from tests/run-check-namespace rename to libunwind/tests/run-check-namespace diff --git a/tests/run-coredump-unwind b/libunwind/tests/run-coredump-unwind similarity index 94% rename from tests/run-coredump-unwind rename to libunwind/tests/run-coredump-unwind index 8d077425..0c2b28c9 100755 --- a/tests/run-coredump-unwind +++ b/libunwind/tests/run-coredump-unwind @@ -48,6 +48,10 @@ fi ./crasher backing_files ) 2>/dev/null COREFILE=$TEMPDIR/core* +if ! test -f "$COREFILE"; then + echo "crasher process did not produce coredump, test skipped" + exit 77 +fi # magic option -testcase enables checking for the specific contents of the stack ./test-coredump-unwind $COREFILE -testcase `cat $TEMPDIR/backing_files` diff --git a/tests/run-coredump-unwind-mdi b/libunwind/tests/run-coredump-unwind-mdi similarity index 100% rename from tests/run-coredump-unwind-mdi rename to libunwind/tests/run-coredump-unwind-mdi diff --git a/tests/run-ia64-test-dyn1 b/libunwind/tests/run-ia64-test-dyn1 similarity index 100% rename from tests/run-ia64-test-dyn1 rename to libunwind/tests/run-ia64-test-dyn1 diff --git a/tests/run-ptrace-mapper b/libunwind/tests/run-ptrace-mapper similarity index 100% rename from tests/run-ptrace-mapper rename to libunwind/tests/run-ptrace-mapper diff --git a/tests/run-ptrace-misc b/libunwind/tests/run-ptrace-misc similarity index 100% rename from tests/run-ptrace-misc rename to libunwind/tests/run-ptrace-misc diff --git a/tests/test-async-sig.c b/libunwind/tests/test-async-sig.c similarity index 100% rename from tests/test-async-sig.c rename to libunwind/tests/test-async-sig.c diff --git a/tests/test-coredump-unwind.c b/libunwind/tests/test-coredump-unwind.c similarity index 100% rename from tests/test-coredump-unwind.c rename to libunwind/tests/test-coredump-unwind.c diff --git a/tests/test-flush-cache.c b/libunwind/tests/test-flush-cache.c similarity index 100% rename from tests/test-flush-cache.c rename to libunwind/tests/test-flush-cache.c diff --git a/tests/test-init-remote.c b/libunwind/tests/test-init-remote.c similarity index 100% rename from tests/test-init-remote.c rename to libunwind/tests/test-init-remote.c diff --git a/tests/test-mem.c b/libunwind/tests/test-mem.c similarity index 100% rename from tests/test-mem.c rename to libunwind/tests/test-mem.c diff --git a/tests/test-proc-info.c b/libunwind/tests/test-proc-info.c similarity index 100% rename from tests/test-proc-info.c rename to libunwind/tests/test-proc-info.c diff --git a/tests/test-ptrace-misc.c b/libunwind/tests/test-ptrace-misc.c similarity index 100% rename from tests/test-ptrace-misc.c rename to libunwind/tests/test-ptrace-misc.c diff --git a/tests/test-ptrace.c b/libunwind/tests/test-ptrace.c similarity index 97% rename from tests/test-ptrace.c rename to libunwind/tests/test-ptrace.c index 67ac9259..32f42e8d 100644 --- a/tests/test-ptrace.c +++ b/libunwind/tests/test-ptrace.c @@ -111,7 +111,7 @@ do_backtrace (void) printf ("%016lx %-32s (sp=%016lx)\n", (long) ip, buf, (long) sp); } - if ((ret = unw_get_proc_info (&c, &pi)) < 0) + if ((ret = unw_get_proc_info (&c, &pi)) < 0 && ret != -UNW_ENOINFO) /* It's possible unw_get_proc_info don't return infomation */ panic ("unw_get_proc_info(ip=0x%lx) failed: ret=%d\n", (long) ip, ret); else if (verbose) printf ("\tproc=%016lx-%016lx\n\thandler=%lx lsda=%lx", @@ -233,7 +233,11 @@ main (int argc, char **argv) fprintf(stderr, "Need to specify a command line for the child\n"); exit (-1); } +#ifdef __FreeBSD__ + execve (argv[optind], argv + optind, environ); +#else execvpe (argv[optind], argv + optind, environ); +#endif _exit (-1); } atexit (target_pid_kill); diff --git a/tests/test-reg-state.c b/libunwind/tests/test-reg-state.c similarity index 100% rename from tests/test-reg-state.c rename to libunwind/tests/test-reg-state.c diff --git a/tests/test-setjmp.c b/libunwind/tests/test-setjmp.c similarity index 100% rename from tests/test-setjmp.c rename to libunwind/tests/test-setjmp.c diff --git a/tests/test-static-link-gen.c b/libunwind/tests/test-static-link-gen.c similarity index 100% rename from tests/test-static-link-gen.c rename to libunwind/tests/test-static-link-gen.c diff --git a/tests/test-static-link-loc.c b/libunwind/tests/test-static-link-loc.c similarity index 100% rename from tests/test-static-link-loc.c rename to libunwind/tests/test-static-link-loc.c diff --git a/tests/test-strerror.c b/libunwind/tests/test-strerror.c similarity index 100% rename from tests/test-strerror.c rename to libunwind/tests/test-strerror.c diff --git a/tests/x64-test-dwarf-expressions.S b/libunwind/tests/x64-test-dwarf-expressions.S similarity index 100% rename from tests/x64-test-dwarf-expressions.S rename to libunwind/tests/x64-test-dwarf-expressions.S diff --git a/tests/x64-unwind-badjmp-signal-frame.c b/libunwind/tests/x64-unwind-badjmp-signal-frame.c similarity index 100% rename from tests/x64-unwind-badjmp-signal-frame.c rename to libunwind/tests/x64-unwind-badjmp-signal-frame.c diff --git a/scripts/kernel-diff.sh b/scripts/kernel-diff.sh deleted file mode 100755 index 459194e1..00000000 --- a/scripts/kernel-diff.sh +++ /dev/null @@ -1,10 +0,0 @@ -kdir=${1:-../kernel} -scriptdir=$(dirname $0) -udir=$(dirname $scriptdir) -cat $scriptdir/kernel-files.txt | \ -(while read l r; do - left=$(eval echo $l) - right=$(eval echo $r) -# echo $left $right - diff -up $left $right -done) diff --git a/scripts/kernel-files.txt b/scripts/kernel-files.txt deleted file mode 100644 index d79e453a..00000000 --- a/scripts/kernel-files.txt +++ /dev/null @@ -1,19 +0,0 @@ -$udir/include/tdep-ia64/rse.h $kdir/arch/ia64/unwind/rse.h -$udir/src/ia64/Ginit_local.c $kdir/arch/ia64/unwind/init_local.c -$udir/src/ia64/Gis_signal_frame.c $kdir/arch/ia64/unwind/is_signal_frame.c -$udir/src/ia64/Gparser.c $kdir/arch/ia64/unwind/parser.c -$udir/src/ia64/Grbs.c $kdir/arch/ia64/unwind/rbs.c -$udir/src/ia64/Gregs.c $kdir/arch/ia64/unwind/regs.c -$udir/src/ia64/Gscript.c $kdir/arch/ia64/unwind/script.c -$udir/src/ia64/Gstep.c $kdir/arch/ia64/unwind/step.c -$udir/src/ia64/init.h $kdir/arch/ia64/unwind/init.h -$udir/src/ia64/offsets.h $kdir/arch/ia64/unwind/offsets.h -$udir/src/ia64/regname.c $kdir/arch/ia64/unwind/regname.c -$udir/src/ia64/regs.h $kdir/arch/ia64/unwind/regs.h -$udir/src/ia64/unwind_decoder.h $kdir/arch/ia64/unwind/unwind_decoder.h -$udir/src/mi/Gget_fpreg.c $kdir/unwind/get_fpreg.c -$udir/src/mi/Gget_reg.c $kdir/unwind/get_reg.c -$udir/src/mi/Gset_fpreg.c $kdir/unwind/set_fpreg.c -$udir/src/mi/Gset_reg.c $kdir/unwind/set_reg.c -$udir/src/mi/flush_cache.c $kdir/unwind/flush_cache.c -$udir/src/mi/mempool.c $kdir/unwind/mempool.c diff --git a/scripts/make-L-files b/scripts/make-L-files deleted file mode 100755 index 8280e3d7..00000000 --- a/scripts/make-L-files +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -cwd=`pwd` -dir=`basename ${cwd}` -# -# When compiling a file that goes into libunwind, we only -# need to compile it when we really do support UNW_LOCAL_ONLY. -# In contrast, libunwind-tests should always get compiled. -# -if test $dir = "tests"; then - local_only_test="" -else - local_only_test="defined(UNW_LOCAL_ONLY) && " -fi -for gname in `ls G*.c G*.cxx G*.S 2>/dev/null`; do - lname="L$(expr $gname : '.\(.*\)')" - bk edit $lname >/dev/null 2>&1 - ext=$(expr $gname : '[^.]*[.]\(.*\)') - if [ "$ext" = "S" ]; then - include="" - else - include="#include " - fi - echo -e "\ -#define UNW_LOCAL_ONLY\n\ -$include\n\ -#if ${local_only_test}!defined(UNW_REMOTE_ONLY)\n\ -#include \"$gname\"\n\ -#endif" > $lname - echo created $lname -done diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 7b087043..00000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,332 +0,0 @@ -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -# other source files -include_directories(../include/tdep) -include_directories(../include) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include/tdep) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include) - -if(TARGET_ARM) - # Ensure that the remote and local unwind code can reside in the same binary without name clashing - add_definitions("-Darm_search_unwind_table=UNW_OBJ(arm_search_unwind_table)") - # We compile code with -std=c99 and the asm keyword is not recognized as it is a gnu extension - add_definitions(-Dasm=__asm__) - # The arm sources include ex_tables.h from include/tdep-arm without going through a redirection - # in include/tdep like it works for similar files on other architectures. So we need to add - # the include/tdep-arm to include directories - include_directories(../include/tdep-arm) -elseif(TARGET_AARCH64) - # We compile code with -std=c99 and the asm keyword is not recognized as it is a gnu extension - add_definitions(-Dasm=__asm__) -endif() - -SET(libunwind_ptrace_la_SOURCES - ptrace/_UPT_elf.c - ptrace/_UPT_accessors.c ptrace/_UPT_access_fpreg.c - ptrace/_UPT_access_mem.c ptrace/_UPT_access_reg.c - ptrace/_UPT_create.c ptrace/_UPT_destroy.c - ptrace/_UPT_find_proc_info.c ptrace/_UPT_get_dyn_info_list_addr.c - ptrace/_UPT_put_unwind_info.c ptrace/_UPT_get_proc_name.c - ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c -) - -SET(libunwind_coredump_la_SOURCES - coredump/_UCD_accessors.c - coredump/_UCD_create.c - coredump/_UCD_destroy.c - coredump/_UCD_access_mem.c - coredump/_UCD_elf_map_image.c - coredump/_UCD_find_proc_info.c - coredump/_UCD_get_proc_name.c - - coredump/_UPT_elf.c - coredump/_UPT_access_fpreg.c - coredump/_UPT_get_dyn_info_list_addr.c - coredump/_UPT_put_unwind_info.c - coredump/_UPT_resume.c -) - -# List of arch-independent files needed by generic library (libunwind-$ARCH): -SET(libunwind_la_SOURCES_generic - mi/Gdyn-extract.c mi/Gdyn-remote.c mi/Gfind_dynamic_proc_info.c - # The Gget_accessors.c implements the same function as Lget_accessors.c, so - # the source is excluded here to prevent name clash - #mi/Gget_accessors.c - mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c - mi/Gput_dynamic_unwind_info.c mi/Gdestroy_addr_space.c - mi/Gget_reg.c mi/Gset_reg.c - mi/Gget_fpreg.c mi/Gset_fpreg.c - mi/Gset_caching_policy.c - mi/Gset_cache_size.c -) - -SET(libunwind_la_SOURCES_os_linux - os-linux.c -) - -SET(libunwind_la_SOURCES_os_linux_local -# Nothing when we don't want to support CXX exceptions -) - -SET(libunwind_la_SOURCES_os_freebsd - os-freebsd.c -) - -SET(libunwind_la_SOURCES_os_freebsd_local -# Nothing -) - -SET(libunwind_la_SOURCES_os_solaris - os-solaris.c -) - -SET(libunwind_la_SOURCES_os_solaris_local -# Nothing -) - -if(UNW_CMAKE_TARGET_LINUX) - SET(libunwind_la_SOURCES_os ${libunwind_la_SOURCES_os_linux}) - SET(libunwind_la_SOURCES_os_local ${libunwind_la_SOURCES_os_linux_local}) - SET(libunwind_la_SOURCES_x86_os x86/Gos-linux.c) - SET(libunwind_x86_la_SOURCES_os x86/getcontext-linux.S) - SET(libunwind_la_SOURCES_x86_os_local x86/Los-linux.c) - SET(libunwind_la_SOURCES_x86_64_os x86_64/Gos-linux.c) - SET(libunwind_la_SOURCES_x86_64_os_local x86_64/Los-linux.c) - SET(libunwind_la_SOURCES_arm_os arm/Gos-linux.c) - SET(libunwind_la_SOURCES_arm_os_local arm/Los-linux.c) - list(APPEND libunwind_coredump_la_SOURCES coredump/_UCD_access_reg_linux.c - coredump/_UCD_get_threadinfo_prstatus.c - coredump/_UCD_get_mapinfo_linux.c) -elseif(UNW_CMAKE_TARGET_FREEBSD) - SET(libunwind_la_SOURCES_os ${libunwind_la_SOURCES_os_freebsd}) - SET(libunwind_la_SOURCES_os_local ${libunwind_la_SOURCES_os_freebsd_local}) - SET(libunwind_la_SOURCES_x86_os x86/Gos-freebsd.c) - SET(libunwind_x86_la_SOURCES_os x86/getcontext-freebsd.S) - SET(libunwind_la_SOURCES_x86_os_local x86/Los-freebsd.c) - SET(libunwind_la_SOURCES_x86_64_os x86_64/Gos-freebsd.c) - SET(libunwind_la_SOURCES_x86_64_os_local x86_64/Los-freebsd.c) - SET(libunwind_la_SOURCES_arm_os arm/Gos-freebsd.c) - SET(libunwind_la_SOURCES_arm_os_local arm/Los-freebsd.c) - list(APPEND libunwind_coredump_la_SOURCES coredump/_UCD_access_reg_freebsd.c - coredump/_UCD_get_threadinfo_prstatus.c - coredump/_UCD_get_mapinfo_generic.c) -elseif(UNW_CMAKE_HOST_SUNOS) - SET(libunwind_la_SOURCES_os ${libunwind_la_SOURCES_os_solaris}) - SET(libunwind_la_SOURCES_os_local ${libunwind_la_SOURCES_os_solaris_local}) - SET(libunwind_la_SOURCES_x86_64_os x86_64/Gos-solaris.c) - SET(libunwind_la_SOURCES_x86_64_os_local x86_64/Los-solaris.c) -endif() - -# List of arch-independent files needed by both local-only and generic -# libraries: -SET(libunwind_la_SOURCES_common - ${libunwind_la_SOURCES_os} - mi/init.c mi/flush_cache.c mi/mempool.c mi/strerror.c -) - -SET(libunwind_la_SOURCES_local_unwind -# Nothing when we don't want to support CXX exceptions -) - -# List of arch-independent files needed by local-only library (libunwind): -SET(libunwind_la_SOURCES_local_nounwind - ${libunwind_la_SOURCES_os_local} - mi/backtrace.c - mi/dyn-cancel.c mi/dyn-info-list.c mi/dyn-register.c - mi/Ldyn-extract.c mi/Lfind_dynamic_proc_info.c - mi/Lget_accessors.c - mi/Lget_proc_info_by_ip.c mi/Lget_proc_name.c - mi/Lput_dynamic_unwind_info.c mi/Ldestroy_addr_space.c - mi/Lget_reg.c mi/Lset_reg.c - mi/Lget_fpreg.c mi/Lset_fpreg.c - mi/Lset_caching_policy.c - mi/Lset_cache_size.c -) - -SET(libunwind_la_SOURCES_local - ${libunwind_la_SOURCES_local_nounwind} - ${libunwind_la_SOURCES_local_unwind} -) - -SET(libunwind_dwarf_common_la_SOURCES - dwarf/global.c -) - -SET(libunwind_dwarf_local_la_SOURCES - dwarf/Lexpr.c dwarf/Lfde.c dwarf/Lparser.c dwarf/Lpe.c - dwarf/Lfind_proc_info-lsb.c - dwarf/Lfind_unwind_table.c -) - -SET(libunwind_dwarf_generic_la_SOURCES - dwarf/Gexpr.c dwarf/Gfde.c dwarf/Gparser.c dwarf/Gpe.c - dwarf/Gfind_proc_info-lsb.c - dwarf/Gfind_unwind_table.c -) - -SET(libunwind_elf32_la_SOURCES - elf32.c -) - -SET(libunwind_elf64_la_SOURCES - elf64.c -) -SET(libunwind_elfxx_la_SOURCES - elfxx.c -) - -# The list of files that go into libunwind and libunwind-aarch64: -SET(libunwind_la_SOURCES_aarch64_common - ${libunwind_la_SOURCES_common} - aarch64/is_fpreg.c - aarch64/regname.c -) - -# The list of files that go into libunwind: -SET(libunwind_la_SOURCES_aarch64 - ${libunwind_la_SOURCES_aarch64_common} - ${libunwind_la_SOURCES_local} - aarch64/Lapply_reg_state.c aarch64/Lreg_states_iterate.c - aarch64/Lcreate_addr_space.c aarch64/Lget_proc_info.c - aarch64/Lget_save_loc.c aarch64/Lglobal.c aarch64/Linit.c - aarch64/Linit_local.c aarch64/Linit_remote.c - aarch64/Lis_signal_frame.c aarch64/Lregs.c aarch64/Lresume.c - aarch64/Lstash_frame.c aarch64/Lstep.c aarch64/Ltrace.c - aarch64/getcontext.S -) - -SET(libunwind_aarch64_la_SOURCES_aarch64 - ${libunwind_la_SOURCES_aarch64_common} - ${libunwind_la_SOURCES_generic} - aarch64/Gapply_reg_state.c aarch64/Greg_states_iterate.c - aarch64/Gcreate_addr_space.c aarch64/Gget_proc_info.c - aarch64/Gget_save_loc.c aarch64/Gglobal.c aarch64/Ginit.c - aarch64/Ginit_local.c aarch64/Ginit_remote.c - aarch64/Gis_signal_frame.c aarch64/Gregs.c aarch64/Gresume.c - aarch64/Gstash_frame.c aarch64/Gstep.c aarch64/Gtrace.c -) - -# The list of files that go into libunwind and libunwind-arm: -SET(libunwind_la_SOURCES_arm_common - ${libunwind_la_SOURCES_common} - arm/is_fpreg.c arm/regname.c -) - -# The list of files that go into libunwind: -SET(libunwind_la_SOURCES_arm - ${libunwind_la_SOURCES_arm_common} - ${libunwind_la_SOURCES_arm_os_local} - ${libunwind_la_SOURCES_local} - arm/getcontext.S - arm/Lapply_reg_state.c arm/Lreg_states_iterate.c - arm/Lcreate_addr_space.c arm/Lget_proc_info.c arm/Lget_save_loc.c - arm/Lglobal.c arm/Linit.c arm/Linit_local.c arm/Linit_remote.c - arm/Lregs.c arm/Lresume.c arm/Lstep.c - arm/Lex_tables.c arm/Lstash_frame.c arm/Ltrace.c -) - -# The list of files that go into libunwind-arm: -SET(libunwind_arm_la_SOURCES_arm - ${libunwind_la_SOURCES_arm_common} - ${libunwind_la_SOURCES_arm_os} - ${libunwind_la_SOURCES_generic} - arm/Gapply_reg_state.c arm/Greg_states_iterate.c - arm/Gcreate_addr_space.c arm/Gget_proc_info.c arm/Gget_save_loc.c - arm/Gglobal.c arm/Ginit.c arm/Ginit_local.c arm/Ginit_remote.c - arm/Gregs.c arm/Gresume.c arm/Gstep.c - arm/Gex_tables.c arm/Gstash_frame.c arm/Gtrace.c -) - -# The list of files that go both into libunwind and libunwind-x86_64: -SET(libunwind_la_SOURCES_x86_64_common - ${libunwind_la_SOURCES_common} - x86_64/is_fpreg.c x86_64/regname.c -) - -# The list of files that go into libunwind: -SET(libunwind_la_SOURCES_x86_64 - ${libunwind_la_SOURCES_x86_64_common} - ${libunwind_la_SOURCES_x86_64_os_local} - ${libunwind_la_SOURCES_local} - x86_64/setcontext.S - x86_64/Lapply_reg_state.c x86_64/Lreg_states_iterate.c - x86_64/Lcreate_addr_space.c x86_64/Lget_save_loc.c x86_64/Lglobal.c - x86_64/Linit.c x86_64/Linit_local.c x86_64/Linit_remote.c - x86_64/Lget_proc_info.c x86_64/Lregs.c x86_64/Lresume.c - x86_64/Lstash_frame.c x86_64/Lstep.c x86_64/Ltrace.c x86_64/getcontext.S -) - -# The list of files that go into libunwind-x86_64: -SET(libunwind_x86_64_la_SOURCES_x86_64 - ${libunwind_la_SOURCES_x86_64_common} - ${libunwind_la_SOURCES_x86_64_os} - ${libunwind_la_SOURCES_generic} - x86_64/Gapply_reg_state.c x86_64/Greg_states_iterate.c - x86_64/Gcreate_addr_space.c x86_64/Gget_save_loc.c x86_64/Gglobal.c - x86_64/Ginit.c x86_64/Ginit_local.c x86_64/Ginit_remote.c - x86_64/Gget_proc_info.c x86_64/Gregs.c x86_64/Gresume.c - x86_64/Gstash_frame.c x86_64/Gstep.c x86_64/Gtrace.c -) - -# The list of files that go both into libunwind and libunwind-s390x: -SET(libunwind_la_SOURCES_s390x_common - ${libunwind_la_SOURCES_common} - s390x/is_fpreg.c s390x/regname.c -) - -# The list of files that go into libunwind: -SET(libunwind_la_SOURCES_s390x - ${libunwind_la_SOURCES_s390x_common} - ${libunwind_la_SOURCES_local} - s390x/setcontext.S s390x/getcontext.S - s390x/Lapply_reg_state.c s390x/Lreg_states_iterate.c - s390x/Lcreate_addr_space.c s390x/Lget_save_loc.c s390x/Lglobal.c - s390x/Linit.c s390x/Linit_local.c s390x/Linit_remote.c - s390x/Lget_proc_info.c s390x/Lregs.c s390x/Lresume.c - s390x/Lis_signal_frame.c s390x/Lstep.c -) - -# The list of files that go into libunwind-s390x: -SET(libunwind_s390x_la_SOURCES_s390x - ${libunwind_la_SOURCES_s390x_common} - ${libunwind_la_SOURCES_generic} - s390x/Gapply_reg_state.c s390x/Greg_states_iterate.c - s390x/Gcreate_addr_space.c s390x/Gget_save_loc.c s390x/Gglobal.c - s390x/Ginit.c s390x/Ginit_local.c s390x/Ginit_remote.c - s390x/Gget_proc_info.c s390x/Gregs.c s390x/Gresume.c - s390x/Gis_signal_frame.c s390x/Gstep.c -) - -if(TARGET_AARCH64) - SET(libunwind_la_SOURCES ${libunwind_la_SOURCES_aarch64}) - SET(libunwind_remote_la_SOURCES ${libunwind_aarch64_la_SOURCES_aarch64}) - SET(libunwind_elf_la_SOURCES ${libunwind_elf64_la_SOURCES}) - list(APPEND libunwind_setjmp_la_SOURCES aarch64/siglongjmp.S) -elseif(TARGET_ARM) - SET(libunwind_la_SOURCES ${libunwind_la_SOURCES_arm}) - SET(libunwind_remote_la_SOURCES ${libunwind_arm_la_SOURCES_arm}) - SET(libunwind_elf_la_SOURCES ${libunwind_elf32_la_SOURCES}) - list(APPEND libunwind_setjmp_la_SOURCES arm/siglongjmp.S) -elseif(TARGET_AMD64) - SET(libunwind_la_SOURCES ${libunwind_la_SOURCES_x86_64}) - SET(libunwind_remote_la_SOURCES ${libunwind_x86_64_la_SOURCES_x86_64}) - SET(libunwind_elf_la_SOURCES ${libunwind_elf64_la_SOURCES}) - list(APPEND libunwind_setjmp_la_SOURCES x86_64/longjmp.S x86_64/siglongjmp.SA) -elseif(TARGET_S390X) - SET(libunwind_la_SOURCES ${libunwind_la_SOURCES_s390x}) - SET(libunwind_remote_la_SOURCES ${libunwind_s390x_la_SOURCES_s390x}) - SET(libunwind_elf_la_SOURCES ${libunwind_elf64_la_SOURCES}) -endif() - -add_library(libunwind - OBJECT - win/pal-single-threaded.c - # ${libunwind_la_SOURCES} Local... - ${libunwind_remote_la_SOURCES} - # Commented out above for LOCAL + REMOTE runtime build - mi/Gget_accessors.c - # ${libunwind_dwarf_local_la_SOURCES} - ${libunwind_dwarf_common_la_SOURCES} - ${libunwind_dwarf_generic_la_SOURCES} - ${libunwind_elf_la_SOURCES} -) diff --git a/src/aarch64/gen-offsets.c b/src/aarch64/gen-offsets.c deleted file mode 100644 index 3d03a77f..00000000 --- a/src/aarch64/gen-offsets.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include - -#define UC(N,X) \ - printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) - -#define SC(N,X) \ - printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) - -int -main (void) -{ - printf ( -"/* Linux-specific definitions: */\n\n" - -"/* Define various structure offsets to simplify cross-compilation. */\n\n" - -"/* Offsets for AArch64 Linux \"ucontext_t\": */\n\n"); - - UC ("FLAGS", uc_flags); - UC ("LINK", uc_link); - UC ("STACK", uc_stack); - UC ("MCONTEXT", uc_mcontext); - UC ("SIGMASK", uc_sigmask); - - printf ("\n/* Offsets for AArch64 Linux \"struct sigcontext\": */\n\n"); - - SC ("R0", regs[0]); - SC ("R1", regs[1]); - SC ("R2", regs[2]); - SC ("R3", regs[3]); - SC ("R4", regs[4]); - SC ("R5", regs[5]); - SC ("R6", regs[6]); - SC ("R7", regs[7]); - SC ("R8", regs[8]); - SC ("R9", regs[9]); - SC ("R10", regs[10]); - SC ("R11", regs[11]); - SC ("R12", regs[12]); - SC ("R13", regs[13]); - SC ("R14", regs[14]); - SC ("R15", regs[15]); - SC ("R16", regs[16]); - SC ("R17", regs[17]); - SC ("R18", regs[18]); - SC ("R19", regs[19]); - SC ("R20", regs[20]); - SC ("R21", regs[21]); - SC ("R22", regs[22]); - SC ("R23", regs[23]); - SC ("R24", regs[24]); - SC ("R25", regs[25]); - SC ("R26", regs[26]); - SC ("R27", regs[27]); - SC ("R28", regs[28]); - SC ("R29", regs[29]); - SC ("R30", regs[30]); - SC ("R31", regs[31]); - - SC ("PC", pc); - SC ("SP", sp); - SC ("Fault", fault_address); - SC ("state", pstate); - return 0; -} diff --git a/src/arm/gen-offsets.c b/src/arm/gen-offsets.c deleted file mode 100644 index 6ebf421c..00000000 --- a/src/arm/gen-offsets.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include - -#define UC(N,X) \ - printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) - -#define SC(N,X) \ - printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) - -int -main (void) -{ - printf ( -"/* Linux-specific definitions: */\n\n" - -"/* Define various structure offsets to simplify cross-compilation. */\n\n" - -"/* Offsets for ARM Linux \"ucontext_t\": */\n\n"); - - UC ("FLAGS", uc_flags); - UC ("LINK", uc_link); - UC ("STACK", uc_stack); - UC ("MCONTEXT", uc_mcontext); - UC ("SIGMASK", uc_sigmask); - UC ("REGSPACE", uc_regspace); - - printf ("\n/* Offsets for ARM Linux \"struct sigcontext\": */\n\n"); - - SC ("TRAPNO", trap_no); - SC ("ERRORCODE", error_code); - SC ("OLDMASK", oldmask); - SC ("R0", arm_r0); - SC ("R1", arm_r1); - SC ("R2", arm_r2); - SC ("R3", arm_r3); - SC ("R4", arm_r4); - SC ("R5", arm_r5); - SC ("R6", arm_r6); - SC ("R7", arm_r7); - SC ("R8", arm_r8); - SC ("R9", arm_r9); - SC ("R10", arm_r10); - SC ("FP", arm_fp); - SC ("IP", arm_ip); - SC ("SP", arm_sp); - SC ("LR", arm_lr); - SC ("PC", arm_pc); - SC ("CPSR", arm_cpsr); - SC ("FAULTADDR", fault_address); - - return 0; -} diff --git a/src/coredump/README b/src/coredump/README deleted file mode 100644 index 204493c9..00000000 --- a/src/coredump/README +++ /dev/null @@ -1,8 +0,0 @@ -This code is based on "unwinding via ptrace" code from ptrace/ -directory. - -Files with names starting with _UCD_ are substantially changed -from their ptrace/_UPT_... progenitors. - -Files which still have _UPT_... names are either verbiatim copies -from ptrace/, or unimplemented stubs. diff --git a/src/hppa/get_accessors.c b/src/hppa/get_accessors.c deleted file mode 100644 index 11e4ecfd..00000000 --- a/src/hppa/get_accessors.c +++ /dev/null @@ -1,38 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2003 Hewlett-Packard Co - Contributed by ... - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "unwind_i.h" - -HIDDEN ALIAS(unw_get_accessors) unw_accessors_t * -unw_get_accessors_int (unw_addr_space_t as); - -unw_accessors_t * -unw_get_accessors (unw_addr_space_t as) -{ - if (!atomic_load(&tdep_init_done)) - tdep_init (); - - return &as->acc; -} diff --git a/src/hppa/tables.c b/src/hppa/tables.c deleted file mode 100644 index 5104d4d3..00000000 --- a/src/hppa/tables.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "unwind_i.h" - -static inline int -is_local_addr_space (unw_addr_space_t as) -{ - extern unw_addr_space_t _ULhppa_local_addr_space; - - return (as == _Uhppa_local_addr_space -#ifndef UNW_REMOTE_ONLY - || as == _ULhppa_local_addr_space -#endif - ); -} - -HIDDEN int -tdep_find_proc_info (unw_addr_space_t as, unw_word_t ip, - unw_proc_info_t *pi, int need_unwind_info, void *arg) -{ - printf ("%s: begging to get implemented...\n", __FUNCTION__); - return 0; -} - -HIDDEN int -tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, - unw_dyn_info_t *di, - unw_proc_info_t *pi, int need_unwind_info, void *arg) -{ - printf ("%s: the biggest beggar of them all...\n", __FUNCTION__); - return 0; -} - -HIDDEN void -tdep_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg) -{ - if (!pi->unwind_info) - return; - - if (!is_local_addr_space (as)) - { - free (pi->unwind_info); - pi->unwind_info = NULL; - } -} diff --git a/src/ia64/NOTES b/src/ia64/NOTES deleted file mode 100644 index a5805e83..00000000 --- a/src/ia64/NOTES +++ /dev/null @@ -1,65 +0,0 @@ -- the frame state consists of the following: - - - ip current instruction pointer - - sp current stack pointer value - - bsp current backing store pointer - - cfm current frame mask - - these are derived from the next younger (more deeply nested) frame - as follows: - - - ip == saved return-link (may be b0 or an alternate branch-reg) - - sp == if younger frame has a fixed-sized frame, sp + size-of-frame, - else saved sp - - cfm == saved ar.pfs - - bsp == if ar.bsp has been saved, saved ar.bsp, otherwise, - ar.bsp \ominus saved ar.pfs.pfm.sol - -The unwind cursor should represent the machine state as it existed at -the address contained in register ip. This state consists of the -*current* frame state and the save locations in the next younger -frame. - -An unwind script current takes the old save locations and updates them -for the next older frame. With the new setup, we need to update the -frame state first, without updating the other save locations. For this -to work, we need the following info: - - - save location of return-link - - save location of ar.pfs - - save location of bsp (if it has been saved) - - size of stack frame (fixed case) or save location of sp - - -setup: - - func: ... - ... - ... - br.call foo <-- call site - ... <-- ip - ... - -initial state: - - The unwind cursor represents the (preserved) machine state - as it existed at "ip". - - Evaluating the unwind descriptors for "ip" yields the following - info: - - - frame size at call site (or previous sp) - - what registers where saved where by func before - the call site was reached - - - Note that there is some procedure info that needs to be obtained - for the new "ip" which is contained in the unwind descriptors. - Specifically, the following is needed: - - - procedure's start address - - personality address - - pointer to language-specific data area - - This info is stored in a separate proc_info structure and needs - to be obtained right after running the unwind script for func. diff --git a/src/mi/Ldyn-remote.c b/src/mi/Ldyn-remote.c deleted file mode 100644 index 260722a0..00000000 --- a/src/mi/Ldyn-remote.c +++ /dev/null @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gdyn-remote.c" -#endif diff --git a/src/mi/maps.c b/src/mi/maps.c deleted file mode 100644 index f9a0021e..00000000 --- a/src/mi/maps.c +++ /dev/null @@ -1,72 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2014 The Android Open Source Project - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "libunwind_i.h" - -void -unw_map_set (unw_addr_space_t as, unw_map_cursor_t *map_cursor) -{ - if (map_cursor != NULL) - as->map_list = map_cursor->map_list; - else - as->map_list = NULL; -} - -int -unw_map_cursor_create (unw_map_cursor_t *map_cursor, pid_t pid) -{ - map_cursor->map_list = maps_create_list (pid); - - return map_cursor->map_list == NULL; -} - -void -unw_map_cursor_destroy (unw_map_cursor_t *map_cursor) -{ - maps_destroy_list (map_cursor->map_list); -} - -void -unw_map_cursor_reset (unw_map_cursor_t *map_cursor) -{ - map_cursor->cur_map = map_cursor->map_list; -} - -int -unw_map_cursor_get (unw_map_cursor_t *map_cursor, unw_map_t *unw_map) -{ - struct map_info *map_info = map_cursor->cur_map; - - if (map_info == NULL) - return 0; - - unw_map->start = map_info->start; - unw_map->end = map_info->end; - unw_map->flags = map_info->flags; - unw_map->path = map_info->path; - - map_cursor->cur_map = map_info + 1; - - return 1; -} diff --git a/src/mingw/pal-single-threaded.c b/src/mingw/pal-single-threaded.c deleted file mode 100755 index 192f666c..00000000 --- a/src/mingw/pal-single-threaded.c +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// This is minimal implementation of posix functions files required to cross compile -// libunwind on a Windows host for UNW_REMOTE_ONLY application. - -// This a completely thread unsafe implementation -// It is likely sufficient for a single thread's usage of UNW_REMOTE_ONLY debugging of -// a read-only dump. - -#include -#include -#include -#include -#include -#include "libunwind_i.h" -#include "compiler.h" - - -int getpagesize(void) -{ - // 4096 is truth for most targets - // Unlikely to matter in dump debugging - return 4096; -} -#if !HAVE_MMAP -void* mmap(void *addr, size_t length, int prot, int flags, int fd, size_t offset) -{ - // We shouldn't be doing anything other than anonymous mappings - if ((flags & MAP_ANONYMOUS) == 0) - return MAP_FAILED; - - return calloc(1, length); -} - -int munmap(void *addr, size_t length) -{ - free(addr); - return 0; -} -#endif - -int sigfillset(sigset_t *set) -{ - return 0; -} -#ifndef MINGW - -int pthread_key_create(pthread_key_t *key, void (*destroy)(void*)) -{ - // We are not implementing pthread_getspecific so this sholdn't matter much - return 0; -} - -int pthread_setspecific(pthread_key_t key, const void *value) -{ - // We are not implementing pthread_getspecific so this sholdn't matter much - return 0; -} - -int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) -{ - // For dump debugging we don't need locking - // We expect to run in a single thread - return 0; -} - -int pthread_mutex_lock(pthread_mutex_t *mutex) -{ - // For dump debugging we don't need locking - // We expect to run in a single thread - return 0; -} - -int pthread_mutex_unlock(pthread_mutex_t *mutex) -{ - // For dump debugging we don't need locking - // We expect to run in a single thread - return 0; -} - -int pthread_once(pthread_once_t *control, void (*init)(void)) -{ - if (control == 0) - return -1; - - // We expect to run in a single thread - // We don't need atomics here - if (*control != PTHREAD_ONCE_INIT) - { - (*init)(); - *control = ~PTHREAD_ONCE_INIT; - } - return 0; -} - - -ssize_t read(int fd, void *buf, size_t count) -{ - // For dump debugging we shouldn't need to open files - // Especially since we didn't implement open() - return -1; -} - -int close(int fd) -{ - // For dump debugging we shouldn't need to open files - // Especially since we didn't implement open() - return -1; -} -// ALIAS(x) is nop. We need this alias to link properly -unw_accessors_t * unw_get_accessors_int (unw_addr_space_t as) -{ - return unw_get_accessors(as); -} -#endif - diff --git a/src/mips/elfxx.c b/src/mips/elfxx.c deleted file mode 100644 index 07d3d12b..00000000 --- a/src/mips/elfxx.c +++ /dev/null @@ -1,27 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2008 CodeSourcery - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "libunwind_i.h" - -#include "../src/elfxx.c" diff --git a/src/mips/gen-offsets.c b/src/mips/gen-offsets.c deleted file mode 100644 index 448f6945..00000000 --- a/src/mips/gen-offsets.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -#define UC(N,X) \ - printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) - -#define SC(N,X) \ - printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) - -int -main (void) -{ - printf ( -"/* Linux-specific definitions: */\n\n" - -"/* Define various structure offsets to simplify cross-compilation. */\n\n" - -"/* Offsets for MIPS Linux \"ucontext_t\": */\n\n"); - - UC ("FLAGS", uc_flags); - UC ("LINK", uc_link); - UC ("STACK", uc_stack); - UC ("MCONTEXT", uc_mcontext); - UC ("SIGMASK", uc_sigmask); - - UC ("MCONTEXT_GREGS", uc_mcontext.gregs); - - return 0; -} diff --git a/src/ohos-config.c b/src/ohos-config.c deleted file mode 100644 index 3d9b6056..00000000 --- a/src/ohos-config.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* This file contains ohos config */ - -#include "libunwind_i.h" - -#define CONF_LINE_SIZE 1024 -#define NUMBER_SIXTEEN 16 - -int config_unwi_debug_level(void) -{ - int ret = 0; - do { - FILE *fp = NULL; - fp = fopen("/system/etc/faultlogger.conf", "r"); - if (fp == NULL) { - break; - } - - while (!feof(fp)) { - char line[CONF_LINE_SIZE] = {0}; - if (fgets(line, CONF_LINE_SIZE - 1, fp) == NULL) { - continue; - } - - if (!strncmp("faultlogLogPersist=true", line, strlen("faultlogLogPersist=true"))) { - ret = NUMBER_SIXTEEN; - } else if (!strncmp("faultlogLogPersist=false", line, strlen("faultlogLogPersist=false"))) { - ret = 0; - } - } - fclose(fp); - } while (0); - return ret; -} diff --git a/src/os-linux.c b/src/os-linux.c deleted file mode 100644 index c47dc15e..00000000 --- a/src/os-linux.c +++ /dev/null @@ -1,349 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2003-2005 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include -#include -#include -#include - -#include "compiler.h" -#include "elfxx.h" -#include "libunwind_i.h" -#include "map_info.h" -#include "os-linux.h" - -HIDDEN struct map_info * -maps_create_list(pid_t pid) -{ - struct map_iterator mi; - unsigned long start, end, offset, flags; - struct map_info *map_list = NULL; - struct map_info *cur_map; - struct map_info *buf; - int index = 0; - if ((maps_init (&mi, pid)) < 0) - return NULL; - int buf_sz = 1024; - buf = (struct map_info*)mmap(NULL, buf_sz * sizeof(struct map_info), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); - if (buf == MAP_FAILED) { - return NULL; - } - - while (maps_next (&mi, &start, &end, &offset, &flags)) - { - if (index >= buf_sz) { - struct map_info *newBuf = (struct map_info *)mmap(NULL, 2 * buf_sz * sizeof(struct map_info), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); - if (buf != MAP_FAILED && newBuf != MAP_FAILED) { - memcpy(newBuf, buf, buf_sz * sizeof(struct map_info)); - munmap(buf, buf_sz * sizeof(struct map_info)); - buf_sz *= 2; - buf = newBuf; - } else { - Dprintf("Lost Map:%p-%p %s\n", (void*)start, (void*)end, mi.path); - continue; - } - } - char *match = strstr(mi.path, "/dev"); - if (match != NULL && match - mi.path == 0) { - continue; - } - cur_map = &buf[index]; - cur_map->start = start; - cur_map->end = end; - cur_map->offset = offset; - cur_map->flags = flags; - cur_map->path = ""; - if (mi.path != NULL) { - cur_map->path = strdup(mi.path); - } - cur_map->ei.size = 0; - cur_map->ei.image = NULL; - cur_map->ei.has_dyn_info = 0; - cur_map->ei.load_bias = -1; - cur_map->ei.strtab = NULL; - cur_map->ei.lib_name_offset = 0; - cur_map->sz = buf_sz; - cur_map->buf = buf; - cur_map->buf_sz = buf_sz; - index = index + 1; - } - if (&buf[0] != NULL) { - map_list = &buf[0]; - map_list->sz = index; - map_list->buf = buf; - map_list->buf_sz = buf_sz; - } else { - munmap(buf, buf_sz * sizeof(struct map_info)); - } - maps_close (&mi); - Debug(12, "Finish create map list, sz:%d, index%d.\n", sz, index); - return map_list; -} - -HIDDEN void -maps_destroy_list(struct map_info *map_info) -{ - struct map_info *map; - int buf_sz = map_info->buf_sz; - void* buf = map_info->buf; - int sz = map_info->sz; - for (int i = 0; i < sz; i++) - { - map = &map_info[i]; - if (map->ei.image != MAP_FAILED && map->ei.image != NULL) { - munmap(map->ei.image, map->ei.size); - map->ei.image = NULL; - } - - if (map->mdi.image != MAP_FAILED && map->mdi.image != NULL) { - munmap(map->mdi.image, map->mdi.size); - map->mdi.image = NULL; - } - - if (map->path) { - free(map->path); - map->path = NULL; - } - map = NULL; - } - if (buf != NULL) { - munmap(buf, buf_sz * sizeof(struct map_info)); - buf = NULL; - } -} - -HIDDEN struct map_info * -get_map(struct map_info *map_list, unw_word_t addr) -{ - if (map_list == NULL) { - return NULL; - } - - struct map_info* buf = map_list->buf; - if (buf == NULL) { - return NULL; - } - - int begin = 0; - int end = map_list->sz - 1; - while (begin <= end) { - int mid = begin + ((end - begin) / 2); - if (addr < buf[mid].start) { - end = mid - 1; - } else if (addr <= buf[mid].end) { - return &buf[mid]; - } else { - begin = mid + 1; - } - } - - if ((begin < map_list->sz) && (addr >= buf[begin].start) && (addr <= buf[begin].end)) { - return &buf[begin]; - } - - Dprintf("Could not find map for addr:%p\n", (void*)addr); - return NULL; -} - -HIDDEN int -maps_is_readable(struct map_info *map_list, unw_word_t addr) -{ -#ifndef UNW_LOCAL_ONLY - if (map_list == NULL) - return 1; -#endif - struct map_info *map = get_map(map_list, addr); - if (map != NULL) - return map->flags & PROT_READ; - return 0; -} - -#ifdef PARSE_ELF_IN_HAP -static int map_elf_in_hap(struct map_info *map) -{ - // elf header is in the first mmap area - // c3840000-c38a6000 r--p 00174000 /data/storage/el1/bundle/entry.hap <- program header - // c38a6000-c3945000 r-xp 001d9000 /data/storage/el1/bundle/entry.hap <- pc is in this region - // c3945000-c394b000 r--p 00277000 /data/storage/el1/bundle/entry.hap - // c394b000-c394c000 rw-p 0027c000 /data/storage/el1/bundle/entry.hap - if (map - 1 == NULL) { - Dprintf("no prev map exist.\n"); - return -1; - } - - struct map_info* prev = map - 1; - struct stat stat; - int fd; - fd = UNW_TEMP_FAILURE_RETRY (open (map->path, O_RDONLY)); - if (fd < 0) { - Dprintf("failed to open hap file.(%d)\n", errno); - return -1; - } - - if (fstat (fd, &stat) < 0) { - Dprintf("failed to stat hap file sz.(%d)\n", errno); - close (fd); - return -1; - } - - size_t size = prev->end - prev->start; - void* elf = mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, prev->offset); - if (elf == MAP_FAILED) { - Dprintf("failed to map program header in hap.(%d)\n", errno); - close (fd); - return -1; - } - - map->ei.size = calc_elf_file_size(elf, size); - // maybe we should get it from phdr. - map->offset = map->offset - prev->offset; - munmap(elf, size); - if (map->ei.size <= 0 || map->ei.size > (size_t)(stat.st_size - prev->offset)) - { - Dprintf("invalid elf size? sz:%d, hap sz:%d", (int)map->ei.size, (int)stat.st_size); - close (fd); - return -1; - } - - map->ei.image = mmap (NULL, map->ei.size, PROT_READ, MAP_PRIVATE, fd, prev->offset); - close (fd); - if (map->ei.image == MAP_FAILED) { - Dprintf("failed to map so in hap.\n"); - return -1; - } - - return 0; -} -#endif - -HIDDEN int -maps_is_writable(struct map_info *map_list, unw_word_t addr) -{ -#ifndef UNW_LOCAL_ONLY - if (map_list == NULL) - return 1; -#endif - struct map_info *map = get_map(map_list, addr); - if (map != NULL) - return map->flags & PROT_WRITE; - return 0; -} - -HIDDEN struct map_info* -tdep_get_elf_image(unw_addr_space_t as, pid_t pid, unw_word_t ip) -{ - struct map_info *map; - struct cursor* cursor = get_cursor_from_as(as); - int find_cached_map = ((cursor != NULL) && (cursor->dwarf.ip == ip)); - if (find_cached_map && - (cursor->dwarf.ip == cursor->dwarf.cached_ip) && cursor->dwarf.cached_map != NULL) { - return cursor->dwarf.cached_map; - } - - if (as->map_list == NULL && pid > 0) { - as->map_list = maps_create_list(pid); - if (as->map_list == NULL) { - Dprintf("Failed to maps_create_list for pid:%d\n", pid); - return NULL; - } - } - - map = get_map(as->map_list, ip); // ip must located in executable map region - if (!map) - return NULL; - - if (map->ei.image == NULL) - { - if (strstr(map->path, ".hap") != NULL) { -#ifdef PARSE_ELF_IN_HAP - if (map_elf_in_hap(map) < 0) { - Dprintf("invalid map_elf_in_hap?\n"); - return NULL; - } -#else - Dprintf("Unsupport map_elf_in_hap\n"); - return NULL; -#endif - } else { - if (elf_map_image(&map->ei, map->path) < 0) { - map->ei.image = NULL; - map->ei.has_try_load = 1; - Dprintf("Failed to elf_map_image for ip:%p\n", (void*)ip); - return NULL; - } - } - map->ei.mdi = &(map->mdi); - } - - if (find_cached_map) { - cursor->dwarf.cached_map = map; - cursor->dwarf.cached_ip = ip; - } - return map; -} - -unw_word_t get_previous_instr_sz(unw_cursor_t *cursor) -{ - struct cursor *c = (struct cursor *) cursor; - unw_addr_space_t as = c->dwarf.as; - unw_accessors_t *a = unw_get_accessors (as); - unw_word_t ip = c->dwarf.ip; - int sz = 4; -#if defined(UNW_TARGET_ARM) - if (ip) - { - if (ip & 1) - { - void *arg; - unw_word_t value; - arg = c->dwarf.as_arg; - // 0xe000f000 ---> machine code of blx Instr (blx label) - if (ip < 5 || (*a->access_mem) (as, ip - 5, &value, 0, arg) < 0 || - (value & 0xe000f000) != 0xe000f000) - sz = 2; - } - } -#elif defined(UNW_TARGET_ARM64) - sz = 4; -#elif defined(UNW_TARGET_X86) - sz = 1; -#elif defined(UNW_TARGET_x86_64) - sz = 1; -#else -// other arch need to be add here. -#endif - return sz; -} - - -#ifndef UNW_REMOTE_ONLY - -void -tdep_get_exe_image_path (char *path) -{ - strcpy(path, "/proc/self/exe"); -} - -#endif /* !UNW_REMOTE_ONLY */ diff --git a/src/os-ohos.c b/src/os-ohos.c deleted file mode 100644 index d8352e27..00000000 --- a/src/os-ohos.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "os-ohos.h" - -#include -#include -#include -#include - -#include "elfxx.h" -#include "libunwind_i.h" - -#define unw_init_local_addr_space UNW_OBJ(init_local_addr_space) - -extern unw_word_t get_previous_instr_sz(unw_cursor_t *cursor); -extern void unw_init_local_addr_space (unw_addr_space_t as); -extern struct map_info *get_map(struct map_info *map_list, unw_word_t addr); - -void -unw_set_target_pid(unw_addr_space_t as, int pid) -{ - as->pid = pid; -} - -unw_word_t -unw_get_rel_pc (unw_cursor_t *cursor) -{ - struct cursor *c = (struct cursor *) cursor; - if (c->dwarf.rel_pc != 0 && c->dwarf.cached_ip == c->dwarf.ip) { - return c->dwarf.rel_pc; - } - - c->dwarf.cached_map = tdep_get_elf_image (c->dwarf.as, c->dwarf.as->pid, c->dwarf.ip); - if (c->dwarf.cached_map == NULL) { - c->dwarf.cached_ip = 0; - return 0; - } - - if (c->dwarf.cached_map->ei.load_bias == -1) { - struct elf_dyn_info edi; - invalidate_edi(&edi); - if (tdep_find_unwind_table (&edi, &(c->dwarf.cached_map->ei), - c->dwarf.as, c->dwarf.cached_map->path, - c->dwarf.cached_map->start, c->dwarf.cached_map->offset, - c->dwarf.ip) < 0) { - return 0; - } - } - - c->dwarf.rel_pc = c->dwarf.ip - - c->dwarf.cached_map->start + - c->dwarf.cached_map->offset + - c->dwarf.cached_map->ei.load_bias; - return c->dwarf.rel_pc; -} - -unw_word_t unw_get_previous_instr_sz(unw_cursor_t *cursor) -{ - return get_previous_instr_sz(cursor); -} - -struct map_info* -unw_get_map (unw_cursor_t *cursor) -{ - struct cursor *c = (struct cursor *) cursor; - return get_map(c->dwarf.as->map_list, c->dwarf.ip); -} - -struct map_info* -unw_get_maps (unw_cursor_t *cursor) -{ - struct cursor *c = (struct cursor *) cursor; - return c->dwarf.as->map_list; -} - -/* -0 success --1 failed, not found -*/ -int -unw_get_symbol_info(struct unw_cursor *cursor, uint64_t pc, int buf_sz, char *buf, uint64_t *sym_start, uint64_t *sym_end) -{ - struct map_info* map = unw_get_map(cursor); - if (map == NULL) { - return -1; - } - - return elf_w (get_symbol_info_in_image)(&(map->ei), map->start, map->offset, pc, buf_sz, buf, sym_start, sym_end); -} - -int -unw_get_symbol_info_by_pc(unw_addr_space_t as, uint64_t pc, int buf_sz, char *buf, uint64_t *sym_start, uint64_t *sym_end) -{ -#ifdef UNW_REMOTE_ONLY - return -1; -#else - if (as->map_list == NULL) { - return -1; - } - - struct map_info* map = tdep_get_elf_image(as, as->pid, pc); - if (map == NULL) { - return -1; - } - - return elf_w (get_symbol_info_in_image)(&(map->ei), map->start, map->offset, pc, buf_sz, buf, sym_start, sym_end); -#endif -} - -void -unw_init_local_address_space(unw_addr_space_t* as) -{ -#ifdef UNW_REMOTE_ONLY - return; -#else - if (as == NULL) { - return; - } - - if (*as != NULL) { - return; - } - - (*as)= (unw_addr_space_t)calloc(1, sizeof(struct unw_addr_space)); - unw_init_local_addr_space(*as); - int pid = -1; - (*as)->pid = pid; - (*as)->map_list = maps_create_list(pid); -#endif -} - -void -unw_destroy_local_address_space(unw_addr_space_t as) -{ -#ifdef UNW_REMOTE_ONLY - return; -#else - if (as == NULL) { - return; - } - - if (as->map_list != NULL) { - maps_destroy_list(as->map_list); - as->map_list = NULL; - } - - free(as); -#endif -} - -void -unw_set_context(unw_cursor_t * cursor, uintptr_t regs[], int reg_sz) -{ - struct cursor *c = (struct cursor *) cursor; - int min_sz = reg_sz < DWARF_NUM_PRESERVED_REGS ? reg_sz : DWARF_NUM_PRESERVED_REGS; - c->dwarf.reg_sz = min_sz; - for (int i = 0; i < min_sz; i++) { - c->dwarf.ctx[i] = regs[i]; - } - -#if defined(__arm__) - c->dwarf.ip = regs[UNW_ARM_R15]; - c->dwarf.cfa = regs[UNW_REG_SP]; -#elif defined(__aarch64__) - c->dwarf.ip = regs[UNW_AARCH64_PC]; - c->dwarf.cfa = regs[UNW_REG_SP]; -#elif defined(__x86_64__) - c->dwarf.ip = regs[UNW_REG_IP]; - c->dwarf.cfa = regs[UNW_REG_SP]; -#endif - return; -} - -void -unw_set_adjust_pc(struct unw_cursor *cursor, uint64_t pc) -{ - struct cursor *c = (struct cursor *) cursor; - c->dwarf.ip = pc; -} - -bool -unw_is_ark_managed_frame(struct cursor* c) -{ - if (c->dwarf.cached_map != NULL) { - Debug(0, "cached map with elf image, not ark frame.\n"); - return false; - } - - struct map_info* map = get_map(c->dwarf.as->map_list, c->dwarf.ip); - if (map == NULL) { - Debug(0, "Not mapped ip.\n"); - return false; - } - - if ((strstr(map->path, "[anon:ArkTS Code]") == NULL) && - (strstr(map->path, "/dev/zero") == NULL)) { - Debug(0, "Not ark map:%s.\n", map->path); - return false; - } - - if ((map->flags & PROT_EXEC) == 0) { - Debug(0, "Target map is not executable.\n"); - return false; - } - - return true; -} - -#define ARK_LIB_NAME "libark_jsruntime.so" -int (*step_ark_managed_native_frame_fn)(int, uintptr_t*, uintptr_t*, uintptr_t*, char*, size_t); -int (*get_ark_js_heap_crash_info_fn)(int, uintptr_t *, uintptr_t *, int, char *, size_t); -void* handle = NULL; // this handle will never be unloaded -pthread_mutex_t lock; - -int -unw_step_ark_managed_native_frame(int pid, uintptr_t* pc, uintptr_t* fp, uintptr_t* sp, char* buf, size_t buf_sz) -{ - if (step_ark_managed_native_frame_fn != NULL) { - return step_ark_managed_native_frame_fn(pid, pc, fp, sp, buf, buf_sz); - } - - pthread_mutex_lock(&lock); - if (step_ark_managed_native_frame_fn != NULL) { - pthread_mutex_unlock(&lock); - return step_ark_managed_native_frame_fn(pid, pc, fp, sp, buf, buf_sz); - } - - if (handle == NULL) { - handle = dlopen(ARK_LIB_NAME, RTLD_LAZY); - if (handle == NULL) { - Dprintf("Failed to load library(%s).\n", dlerror()); - pthread_mutex_unlock(&lock); - return -1; - } - } - - *(void**)(&step_ark_managed_native_frame_fn) = dlsym(handle, "step_ark_managed_native_frame"); - if (!step_ark_managed_native_frame_fn) { - Dprintf("Failed to find symbol(%s).\n", dlerror()); - handle = NULL; - pthread_mutex_unlock(&lock); - return -1; - } - - pthread_mutex_unlock(&lock); - return step_ark_managed_native_frame_fn(pid, pc, fp, sp, buf, buf_sz); -} - -int -unw_get_ark_js_heap_crash_info(int pid, uintptr_t* x20, uintptr_t* fp, int out_js_info, char* buf, size_t buf_sz) -{ - if (get_ark_js_heap_crash_info_fn != NULL) { - return get_ark_js_heap_crash_info_fn(pid, x20, fp, out_js_info, buf, buf_sz); - } - - pthread_mutex_lock(&lock); - if (get_ark_js_heap_crash_info_fn != NULL) { - pthread_mutex_unlock(&lock); - return get_ark_js_heap_crash_info_fn(pid, x20, fp, out_js_info, buf, buf_sz); - } - - if (handle == NULL) { - handle = dlopen(ARK_LIB_NAME, RTLD_LAZY); - if (handle == NULL) { - Dprintf("Failed to load library(%s).\n", dlerror()); - pthread_mutex_unlock(&lock); - return -1; - } - } - - *(void**)(&get_ark_js_heap_crash_info_fn) = dlsym(handle, "get_ark_js_heap_crash_info"); - if (!get_ark_js_heap_crash_info_fn) { - Dprintf("Failed to find symbol(%s).\n", dlerror()); - handle = NULL; - pthread_mutex_unlock(&lock); - return -1; - } - - pthread_mutex_unlock(&lock); - return get_ark_js_heap_crash_info_fn(pid, x20, fp, out_js_info, buf, buf_sz); -} - -bool -unw_get_build_id (struct map_info* map, uint8_t** build_id_ptr, size_t* length) -{ -#ifdef PARSE_BUILD_ID - if (map == NULL) { - return false; - } - - if (map->ei.build_id_note == NULL) { - return false; - } - - *build_id_ptr = map->ei.build_id_note->build_id; - *length = map->ei.build_id_note->nhdr.n_descsz; - return true; -#else - return false; -#endif -} - -int -unw_get_library_name_by_map(struct map_info* map, char *buf, int buf_sz) -{ - if (map == NULL || buf == NULL) { - Dprintf("Invaild map_info or buffer.\n"); - return -1; - } - - if (map->ei.image == NULL || map->ei.lib_name_offset == 0) { - Dprintf("Invaild elf_image or lib_name_offset.\n"); - return -1; - } - - if (map->ei.strtab == NULL) { - Dprintf("Invaild str_tab.\n"); - return -1; - } - - if (strlen(map->ei.strtab + map->ei.lib_name_offset) > 1024) { - Dprintf("Invaild library name.\n"); - return -1; - } - - strncpy (buf, map->ei.strtab + map->ei.lib_name_offset, buf_sz); - return 0; -} diff --git a/src/os-ohos.h b/src/os-ohos.h deleted file mode 100644 index 2e3b99bf..00000000 --- a/src/os-ohos.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OS_OHOS_H -#define OS_OHOS_H - -#include -#include - -#include "libunwind_i.h" - -struct map_info; -struct unw_cursor; - -extern unw_word_t unw_get_rel_pc (struct unw_cursor *cursor); -extern unw_word_t unw_get_previous_instr_sz(unw_cursor_t *cursor); -extern struct map_info* unw_get_map (struct unw_cursor *cursor); -extern struct map_info* unw_get_maps (struct unw_cursor *cursor); -extern int unw_get_symbol_info(struct unw_cursor *cursor, uint64_t pc, int buf_sz, char *buf, uint64_t *sym_start, uint64_t *sym_end); -extern int unw_get_symbol_info_by_pc(unw_addr_space_t as, uint64_t pc, int buf_sz, char *buf, uint64_t *sym_start, uint64_t *sym_end); -extern void unw_set_target_pid(unw_addr_space_t as, int pid); -extern void unw_init_local_address_space(unw_addr_space_t* as); -extern void unw_destroy_local_address_space(unw_addr_space_t as); -extern void unw_set_context(unw_cursor_t * cursor, uintptr_t regs[], int reg_sz); -extern void unw_set_adjust_pc(struct unw_cursor *cursor, uint64_t pc); -extern int unw_step_ark_managed_native_frame(int pid, uintptr_t* pc, uintptr_t* fp, uintptr_t* sp, char* buf, size_t buf_sz); -extern int unw_get_ark_js_heap_crash_info(int pid, uintptr_t* x20, uintptr_t* fp, int out_js_info, char* buf, size_t buf_sz); -extern bool unw_is_ark_managed_frame(struct cursor* c); -extern bool unw_get_build_id(struct map_info* map, uint8_t** build_id_ptr, size_t* length); -extern int unw_get_library_name_by_map(struct map_info* map, char *buf, int buf_sz); - -#endif diff --git a/src/ppc32/Make-arch.in b/src/ppc32/Make-arch.in deleted file mode 100644 index 947dd5fa..00000000 --- a/src/ppc32/Make-arch.in +++ /dev/null @@ -1,11 +0,0 @@ -# Word size. -ELFW = 64 -# Does use dwarf2 unwind info. -dwarf_target = true - -libunwind_setjmp_OBJS += \ - $(arch)/longjmp.o \ - $(arch)/siglongjmp.o - -libunwind_OBJS_common += \ - $(arch)/is_fpreg.o diff --git a/src/ppc32/setcontext.S b/src/ppc32/setcontext.S deleted file mode 100644 index b54378a9..00000000 --- a/src/ppc32/setcontext.S +++ /dev/null @@ -1,9 +0,0 @@ - .global _UI_setcontext - -_UI_setcontext: - retq - -#ifdef __linux__ - /* We do not need executable stack. */ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/src/ppc64/setcontext.S b/src/ppc64/setcontext.S deleted file mode 100644 index ffc2500a..00000000 --- a/src/ppc64/setcontext.S +++ /dev/null @@ -1,9 +0,0 @@ - .global _UI_setcontext - -_UI_setcontext: - blr - -#ifdef __linux__ - /* We do not need executable stack. */ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/src/setjmp/setjmp.c b/src/setjmp/setjmp.c deleted file mode 100644 index bec9fc7d..00000000 --- a/src/setjmp/setjmp.c +++ /dev/null @@ -1,49 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2003-2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include -#include - -#include "jmpbuf.h" - -/* Why use K&R syntax here? setjmp() is often a macro and that - expands into a call to, say, __setjmp() and we need to define the - libunwind-version of setjmp() with the name of the actual function. - Using K&R syntax lets us keep the setjmp() macro while keeping the - syntax valid... This trick works provided setjmp() doesn't do - anything other than a function call. */ - -int -setjmp (env) - jmp_buf env; -{ - void **wp = (void **) env; - - /* this should work on most platforms, but may not be - performance-optimal; check the code! */ - wp[JB_SP] = __builtin_frame_address (0); - wp[JB_RP] = (void *) __builtin_return_address (0); - return 0; -} diff --git a/src/setjmp/sigsetjmp.c b/src/setjmp/sigsetjmp.c deleted file mode 100644 index f84935d6..00000000 --- a/src/setjmp/sigsetjmp.c +++ /dev/null @@ -1,50 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2003-2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include -#include -#include - -#include "jmpbuf.h" - -int -sigsetjmp (sigjmp_buf env, int savemask) -{ - unw_word_t *wp = (unw_word_t *) env; - - /* This should work on most platforms, but may not be - performance-optimal; check the code! */ - - wp[JB_SP] = (unw_word_t) __builtin_frame_address (0); - wp[JB_RP] = (unw_word_t) __builtin_return_address (0); - wp[JB_MASK_SAVED] = savemask; - - /* Note: we assume here that "wp" has same or better alignment as - sigset_t. */ - if (savemask - && sigprocmask (SIG_BLOCK, NULL, (sigset_t *) (wp + JB_MASK)) < 0) - abort (); - return 0; -} diff --git a/src/sh/gen-offsets.c b/src/sh/gen-offsets.c deleted file mode 100644 index 16695a64..00000000 --- a/src/sh/gen-offsets.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include - -#define UC(N,X) \ - printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) - -#define SC(N,X) \ - printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) - -int -main (void) -{ - printf ( -"/* Linux-specific definitions: */\n\n" - -"/* Define various structure offsets to simplify cross-compilation. */\n\n" - -"/* Offsets for SH Linux \"ucontext_t\": */\n\n"); - - UC ("FLAGS", uc_flags); - UC ("LINK", uc_link); - UC ("STACK", uc_stack); - UC ("MCONTEXT", uc_mcontext); - UC ("SIGMASK", uc_sigmask); - - printf ("\n/* Offsets for SH Linux \"struct sigcontext\": */\n\n"); - - SC ("R0", sc_regs[0]); - SC ("R1", sc_regs[1]); - SC ("R2", sc_regs[2]); - SC ("R3", sc_regs[3]); - SC ("R4", sc_regs[4]); - SC ("R5", sc_regs[5]); - SC ("R6", sc_regs[6]); - SC ("R7", sc_regs[7]); - SC ("R8", sc_regs[8]); - SC ("R9", sc_regs[9]); - SC ("R10", sc_regs[10]); - SC ("R11", sc_regs[11]); - SC ("R12", sc_regs[12]); - SC ("R13", sc_regs[13]); - SC ("R14", sc_regs[14]); - SC ("R15", sc_regs[15]); - - SC ("PC", sc_pc); - SC ("PR", sc_pr); - - return 0; -} diff --git a/src/tilegx/Lis_signal_frame.c b/src/tilegx/Lis_signal_frame.c deleted file mode 100644 index b9a7c4f5..00000000 --- a/src/tilegx/Lis_signal_frame.c +++ /dev/null @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gis_signal_frame.c" -#endif diff --git a/src/tilegx/elfxx.c b/src/tilegx/elfxx.c deleted file mode 100644 index 07d3d12b..00000000 --- a/src/tilegx/elfxx.c +++ /dev/null @@ -1,27 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2008 CodeSourcery - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "libunwind_i.h" - -#include "../src/elfxx.c" diff --git a/src/tilegx/gen-offsets.c b/src/tilegx/gen-offsets.c deleted file mode 100644 index 8704bb21..00000000 --- a/src/tilegx/gen-offsets.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include - -#define UC(N,X) \ - printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) - -#define SC(N,X) \ - printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) - -int -main (void) -{ - printf ( -"/* Linux-specific definitions: */\n\n" - -"/* Define various structure offsets to simplify cross-compilation. */\n\n" - -"/* Offsets for TILEGX Linux \"ucontext_t\": */\n\n"); - - UC ("FLAGS", uc_flags); - UC ("LINK", uc_link); - UC ("STACK", uc_stack); - UC ("MCONTEXT", uc_mcontext); - UC ("SIGMASK", uc_sigmask); - - UC ("MCONTEXT_GREGS", uc_mcontext.gregs); - - return 0; -} diff --git a/src/win/pal-single-threaded.c b/src/win/pal-single-threaded.c deleted file mode 100644 index 88a57fdb..00000000 --- a/src/win/pal-single-threaded.c +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// This is minimal implementation of posix functions files required to cross compile -// libunwind on a Windows host for UNW_REMOTE_ONLY application. - -// This a completely thread unsafe implementation -// It is likely sufficient for a single thread's usage of UNW_REMOTE_ONLY debugging of -// a read-only dump. - -#include -#include -#include -#include -#include -#include "libunwind_i.h" -#include "compiler.h" - - -int getpagesize(void) -{ - // 4096 is truth for most targets - // Unlikely to matter in dump debugging - return 4096; -} - -void* mmap(void *addr, size_t length, int prot, int flags, int fd, size_t offset) -{ - // We shouldn't be doing anything other than anonymous mappings - if ((flags & MAP_ANONYMOUS) == 0) - return MAP_FAILED; - - return calloc(1, length); -} - -int munmap(void *addr, size_t length) -{ - free(addr); - return 0; -} - -int pthread_key_create(pthread_key_t *key, void (*destroy)(void*)) -{ - // We are not implementing pthread_getspecific so this sholdn't matter much - return 0; -} - -int pthread_setspecific(pthread_key_t key, const void *value) -{ - // We are not implementing pthread_getspecific so this sholdn't matter much - return 0; -} - -int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) -{ - // For dump debugging we don't need locking - // We expect to run in a single thread - return 0; -} - -int pthread_mutex_lock(pthread_mutex_t *mutex) -{ - // For dump debugging we don't need locking - // We expect to run in a single thread - return 0; -} - -int pthread_mutex_unlock(pthread_mutex_t *mutex) -{ - // For dump debugging we don't need locking - // We expect to run in a single thread - return 0; -} - -int pthread_once(pthread_once_t *control, void (*init)(void)) -{ - if (control == 0) - return -1; - - // We expect to run in a single thread - // We don't need atomics here - if (*control != PTHREAD_ONCE_INIT) - { - (*init)(); - *control = ~PTHREAD_ONCE_INIT; - } - return 0; -} - -int sigfillset(sigset_t *set) -{ - return 0; -} - -ssize_t read(int fd, void *buf, size_t count) -{ - // For dump debugging we shouldn't need to open files - // Especially since we didn't implement open() - return -1; -} - -int close(int fd) -{ - // For dump debugging we shouldn't need to open files - // Especially since we didn't implement open() - return -1; -} - -// ALIAS(x) is nop. We need this alias to link properly -unw_accessors_t * unw_get_accessors_int (unw_addr_space_t as) -{ - return unw_get_accessors(as); -} diff --git a/src/x86_64/Gapply_reg_state.c b/src/x86_64/Gapply_reg_state.c deleted file mode 100644 index 82f056da..00000000 --- a/src/x86_64/Gapply_reg_state.c +++ /dev/null @@ -1,37 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. - Contributed by David Mosberger-Tang - - Modified for x86_64 by Max Asbock - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "unwind_i.h" - -int -unw_apply_reg_state (unw_cursor_t *cursor, - void *reg_states_data) -{ - struct cursor *c = (struct cursor *) cursor; - - return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); -} diff --git a/src/x86_64/Greg_states_iterate.c b/src/x86_64/Greg_states_iterate.c deleted file mode 100644 index a17dc1b5..00000000 --- a/src/x86_64/Greg_states_iterate.c +++ /dev/null @@ -1,37 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. - Contributed by David Mosberger-Tang - - Modified for x86_64 by Max Asbock - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "unwind_i.h" - -int -unw_reg_states_iterate (unw_cursor_t *cursor, - unw_reg_states_callback cb, void *token) -{ - struct cursor *c = (struct cursor *) cursor; - - return dwarf_reg_states_iterate (&c->dwarf, cb, token); -} diff --git a/src/x86_64/Lapply_reg_state.c b/src/x86_64/Lapply_reg_state.c deleted file mode 100644 index 7ebada48..00000000 --- a/src/x86_64/Lapply_reg_state.c +++ /dev/null @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gapply_reg_state.c" -#endif diff --git a/src/x86_64/Lreg_states_iterate.c b/src/x86_64/Lreg_states_iterate.c deleted file mode 100644 index f1eb1e79..00000000 --- a/src/x86_64/Lreg_states_iterate.c +++ /dev/null @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Greg_states_iterate.c" -#endif diff --git a/tests/dummy_backtrace.c b/tests/dummy_backtrace.c deleted file mode 100644 index b68fa587..00000000 --- a/tests/dummy_backtrace.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -int backtrace(void** data, int size) -{ - (void)data; - (void)size; - return -1; -} diff --git a/tests/perf-startup b/tests/perf-startup deleted file mode 100755 index 1c24e9a9..00000000 --- a/tests/perf-startup +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -platform=$1 -LIBUNWIND=../src/.libs/libunwind.so -LIBUNWIND_PLAT=../src/.libs/libunwind-$platform.so -warmup=$(./forker 2000 /bin/true | cut -f1 -d' ') - -nsec1=$(./forker 2000 /bin/true | cut -f1 -d' ') -printf "\"/bin/true\"\t\t\t\t\t\t: $nsec1 nsec/execution\n" - -nsec2=$(LD_PRELOAD=$LIBUNWIND ./forker 2000 /bin/true | cut -f1 -d' ') -printf "\"LD_PRELOAD=$LIBUNWIND /bin/true\"\t: $nsec2 nsec/execution\n" - -nsec3=$(LD_PRELOAD=$LIBUNWIND_PLAT ./forker 2000 /bin/true | cut -f1 -d' ') -printf "\"LD_PRELOAD=$LIBUNWIND_PLAT /bin/true\"\t: $nsec3 nsec/execution\n" - -echo - -printf "Overhead of preloading $LIBUNWIND\t: $(($nsec2 - $nsec1)) nsec\n" -printf "Overhead of preloading $LIBUNWIND_PLAT\t: $(($nsec3 - $nsec1)) nsec\n"