diff --git a/glibc.spec b/glibc.spec index 0c8ea9e..c65cd46 100644 --- a/glibc.spec +++ b/glibc.spec @@ -157,7 +157,7 @@ end \ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 222%{?dist} +Release: 223%{?dist} # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. @@ -199,6 +199,12 @@ Source11: parse-SUPPORTED.py Source12: ChangeLog.old Source13: nscd-sysusers.conf Source14: glibc.abignore +Source15: verify-ld-so-abi.sh +Source16: ld-so-abi-aarch64.baseline +Source17: ld-so-abi-i386.baseline +Source18: ld-so-abi-ppc64le.baseline +Source19: ld-so-abi-s390x.baseline +Source20: ld-so-abi-x86_64.baseline # glibc_ldso: ABI-specific program interpreter name. Used for debuginfo # extraction (wrap-find-debuginfo.sh) and smoke testing ($run_ldso below). @@ -1393,6 +1399,10 @@ BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext BuildRequires: procps-ng, util-linux, gawk BuildRequires: systemtap-sdt-devel +%if %{with testsuite} +BuildRequires: gdb +%endif + %if %{with valgrind} # Require valgrind for smoke testing the dynamic loader to make sure we # have not broken valgrind. @@ -2219,6 +2229,12 @@ diff -u \ --label "glibc localedata/SUPPORTED" localedata/SUPPORTED.glibc rm localedata/SUPPORTED.spec localedata/SUPPORTED.glibc +# Prepare for ld.so ABI check +cp %{SOURCE15} . +chmod +x verify-ld-so-abi.sh + +cp %{_sourcedir}/*.baseline . + ############################################################################## # Build glibc... ############################################################################## @@ -2987,6 +3003,11 @@ $run_ldso /usr/bin/valgrind --error-exitcode=1 \ %endif %endif +# Verify ld.so ABI. +if test -f "ld-so-abi-%{_arch}.baseline" ; then + ./verify-ld-so-abi.sh %{_arch} %{glibc_sysroot}%{_prefix}%{glibc_ldso} +fi + %endif @@ -3397,6 +3418,9 @@ update_gconv_modules_cache () %endif %changelog +* Wed Jul 30 2025 Frédéric Bérat - 2.34-223 +- Add ld-so-abi-check + * Wed Jul 30 2025 Florian Weimer - 2.34-222 - Build glibc32 from the main glibc package (RHEL-106470) diff --git a/ld-so-abi-aarch64.baseline b/ld-so-abi-aarch64.baseline new file mode 100644 index 0000000..77ed91b --- /dev/null +++ b/ld-so-abi-aarch64.baseline @@ -0,0 +1,541 @@ +--- _rtld_global_ro --- +/* offset | size */ type = struct rtld_global_ro { +/* 0 | 4 */ int _dl_debug_mask; +/* 4 | 4 */ unsigned int _dl_osversion; +/* 8 | 8 */ const char *_dl_platform; +/* 16 | 8 */ size_t _dl_platformlen; +/* 24 | 8 */ size_t _dl_pagesize; +/* 32 | 8 */ size_t _dl_minsigstacksize; +/* 40 | 4 */ int _dl_inhibit_cache; +/* XXX 4-byte hole */ +/* 48 | 16 */ struct r_scope_elem { +/* 48 | 8 */ struct link_map **r_list; +/* 56 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } _dl_initial_searchlist; +/* 64 | 4 */ int _dl_clktck; +/* 68 | 4 */ int _dl_verbose; +/* 72 | 4 */ int _dl_debug_fd; +/* 76 | 4 */ int _dl_lazy; +/* 80 | 4 */ int _dl_bind_not; +/* 84 | 4 */ int _dl_dynamic_weak; +/* 88 | 4 */ fpu_control_t _dl_fpu_control; +/* 92 | 4 */ int _dl_correct_cache_id; +/* 96 | 8 */ uint64_t _dl_hwcap; +/* 104 | 8 */ Elf64_auxv_t *_dl_auxv; +/* 112 | 16 */ struct cpu_features { +/* 112 | 8 */ uint64_t midr_el1; +/* 120 | 4 */ unsigned int zva_size; +/* 124 | 1 */ _Bool bti; +/* 125 | 1 */ uint8_t mte_state; +/* 126 | 1 */ _Bool sve; +/* XXX 1-byte padding */ + + /* total size (bytes): 16 */ + } _dl_aarch64_cpu_features; +/* 128 | 320 */ const char _dl_aarch64_cap_flags[32][10]; +/* 448 | 8 */ const char *_dl_inhibit_rpath; +/* 456 | 8 */ const char *_dl_origin_path; +/* 464 | 8 */ Elf64_Addr _dl_use_load_bias; +/* 472 | 8 */ size_t _dl_tls_static_size; +/* 480 | 8 */ size_t _dl_tls_static_align; +/* 488 | 8 */ size_t _dl_tls_static_surplus; +/* 496 | 8 */ const char *_dl_profile; +/* 504 | 8 */ const char *_dl_profile_output; +/* 512 | 8 */ const char *_dl_trace_prelink; +/* 520 | 8 */ struct link_map *_dl_trace_prelink_map; +/* 528 | 8 */ struct r_search_path_elem *_dl_init_all_dirs; +/* 536 | 8 */ const Elf64_Ehdr *_dl_sysinfo_dso; +/* 544 | 8 */ struct link_map *_dl_sysinfo_map; +/* 552 | 8 */ int (*_dl_vdso_clock_gettime64)(clockid_t, struct timespec *); +/* 560 | 8 */ int (*_dl_vdso_gettimeofday)(struct timeval *, void *); +/* 568 | 8 */ int (*_dl_vdso_clock_getres_time64)(clockid_t, struct timespec *); +/* 576 | 8 */ uint64_t _dl_hwcap2; +/* 584 | 4 */ enum dso_sort_algorithm _dl_dso_sort_algo; +/* XXX 4-byte hole */ +/* 592 | 8 */ void (*_dl_debug_printf)(const char *, ...); +/* 600 | 8 */ void (*_dl_mcount)(Elf64_Addr, Elf64_Addr); +/* 608 | 8 */ lookup_t (*_dl_lookup_symbol_x)(const char *, struct link_map *, const Elf64_Sym **, struct r_scope_elem **, const struct r_found_version *, int, int, struct link_map *); +/* 616 | 8 */ void *(*_dl_open)(const char *, int, const void *, Lmid_t, int, char **, char **); +/* 624 | 8 */ void (*_dl_close)(void *); +/* 632 | 8 */ int (*_dl_catch_error)(const char **, const char **, _Bool *, void (*)(void *), void *); +/* 640 | 8 */ void (*_dl_error_free)(void *); +/* 648 | 8 */ void *(*_dl_tls_get_addr_soft)(struct link_map *); +/* 656 | 8 */ int (*_dl_discover_osversion)(void); +/* 664 | 8 */ const struct dlfcn_hook *_dl_dlfcn_hook; +/* 672 | 8 */ struct audit_ifaces *_dl_audit; +/* 680 | 4 */ unsigned int _dl_naudit; +/* XXX 4-byte padding */ + + /* total size (bytes): 688 */ + } +--- _rtld_global --- +/* offset | size */ type = struct rtld_global { +/* 0 | 2560 */ struct link_namespaces _dl_ns[16]; +/* 2560 | 8 */ size_t _dl_nns; +/* 2568 | 48 */ __rtld_lock_recursive_t _dl_load_lock; +/* 2616 | 48 */ __rtld_lock_recursive_t _dl_load_write_lock; +/* 2664 | 48 */ __rtld_lock_recursive_t _dl_load_tls_lock; +/* 2712 | 8 */ unsigned long long _dl_load_adds; +/* 2720 | 8 */ struct link_map *_dl_initfirst; +/* 2728 | 8 */ struct link_map *_dl_profile_map; +/* 2736 | 8 */ unsigned long _dl_num_relocations; +/* 2744 | 8 */ unsigned long _dl_num_cache_relocations; +/* 2752 | 8 */ struct r_search_path_elem *_dl_all_dirs; +/* 2760 | 1200 */ struct link_map { +/* 2760 | 8 */ Elf64_Addr l_addr; +/* 2768 | 8 */ char *l_name; +/* 2776 | 8 */ Elf64_Dyn *l_ld; +/* 2784 | 8 */ struct link_map *l_next; +/* 2792 | 8 */ struct link_map *l_prev; +/* 2800 | 8 */ struct link_map *l_real; +/* 2808 | 8 */ Lmid_t l_ns; +/* 2816 | 8 */ struct libname_list *l_libname; +/* 2824 | 664 */ Elf64_Dyn *l_info[83]; +/* 3488 | 8 */ const Elf64_Phdr *l_phdr; +/* 3496 | 8 */ Elf64_Addr l_entry; +/* 3504 | 2 */ Elf64_Half l_phnum; +/* 3506 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 3512 | 16 */ struct r_scope_elem { +/* 3512 | 8 */ struct link_map **r_list; +/* 3520 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 3528 | 16 */ struct r_scope_elem { +/* 3528 | 8 */ struct link_map **r_list; +/* 3536 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 3544 | 8 */ struct link_map *l_loader; +/* 3552 | 8 */ struct r_found_version *l_versions; +/* 3560 | 4 */ unsigned int l_nversions; +/* 3564 | 4 */ Elf_Symndx l_nbuckets; +/* 3568 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 3572 | 4 */ Elf32_Word l_gnu_shift; +/* 3576 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 3584 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 3592 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 3600 | 4 */ unsigned int l_direct_opencount; +/* 3604: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 3604: 2 | 4 */ unsigned int l_relocated : 1; +/* 3604: 3 | 4 */ unsigned int l_init_called : 1; +/* 3604: 4 | 4 */ unsigned int l_global : 1; +/* 3604: 5 | 4 */ unsigned int l_reserved : 2; +/* 3604: 7 | 4 */ unsigned int l_main_map : 1; +/* 3605: 0 | 4 */ unsigned int l_visited : 1; +/* 3605: 1 | 4 */ unsigned int l_map_used : 1; +/* 3605: 2 | 4 */ unsigned int l_map_done : 1; +/* 3605: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 3605: 4 | 4 */ unsigned int l_soname_added : 1; +/* 3605: 5 | 4 */ unsigned int l_faked : 1; +/* 3605: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 3605: 7 | 4 */ unsigned int l_auditing : 1; +/* 3606: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 3606: 1 | 4 */ unsigned int l_removed : 1; +/* 3606: 2 | 4 */ unsigned int l_contiguous : 1; +/* 3606: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 3606: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 3606: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 3606: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 3606: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 3607 | 1 */ _Bool l_nodelete_active; +/* 3608 | 1 */ _Bool l_nodelete_pending; +/* XXX 7-byte hole */ +/* 3616 | 16 */ struct r_search_path_struct { +/* 3616 | 8 */ struct r_search_path_elem **dirs; +/* 3624 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 3632 | 8 */ struct reloc_result *l_reloc_result; +/* 3640 | 8 */ Elf64_Versym *l_versyms; +/* 3648 | 8 */ const char *l_origin; +/* 3656 | 8 */ Elf64_Addr l_map_start; +/* 3664 | 8 */ Elf64_Addr l_map_end; +/* 3672 | 8 */ Elf64_Addr l_text_end; +/* 3680 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 3712 | 8 */ size_t l_scope_max; +/* 3720 | 8 */ struct r_scope_elem **l_scope; +/* 3728 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 3744 | 16 */ struct r_file_id { +/* 3744 | 8 */ dev_t dev; +/* 3752 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 3760 | 16 */ struct r_search_path_struct { +/* 3760 | 8 */ struct r_search_path_elem **dirs; +/* 3768 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 3776 | 8 */ struct link_map **l_initfini; +/* 3784 | 8 */ struct link_map_reldeps *l_reldeps; +/* 3792 | 4 */ unsigned int l_reldepsmax; +/* 3796 | 4 */ unsigned int l_used; +/* 3800 | 4 */ Elf64_Word l_feature_1; +/* 3804 | 4 */ Elf64_Word l_flags_1; +/* 3808 | 4 */ Elf64_Word l_flags; +/* 3812 | 4 */ int l_idx; +/* 3816 | 24 */ struct link_map_machine { +/* 3816 | 8 */ Elf64_Addr plt; +/* 3824 | 8 */ void *tlsdesc_table; +/* 3832 | 1 */ _Bool bti_fail; +/* XXX 7-byte padding */ + + /* total size (bytes): 24 */ + } l_mach; +/* 3840 | 32 */ struct { +/* 3840 | 8 */ const Elf64_Sym *sym; +/* 3848 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 3856 | 8 */ struct link_map *value; +/* 3864 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 3872 | 8 */ void *l_tls_initimage; +/* 3880 | 8 */ size_t l_tls_initimage_size; +/* 3888 | 8 */ size_t l_tls_blocksize; +/* 3896 | 8 */ size_t l_tls_align; +/* 3904 | 8 */ size_t l_tls_firstbyte_offset; +/* 3912 | 8 */ ptrdiff_t l_tls_offset; +/* 3920 | 8 */ size_t l_tls_modid; +/* 3928 | 8 */ size_t l_tls_dtor_count; +/* 3936 | 8 */ Elf64_Addr l_relro_addr; +/* 3944 | 8 */ size_t l_relro_size; +/* 3952 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1200 */ + } _dl_rtld_map; +/* 3960 | 256 */ struct auditstate _dl_rtld_auditstate[16]; +/* 4216 | 4 */ Elf64_Word _dl_stack_flags; +/* 4220 | 1 */ _Bool _dl_tls_dtv_gaps; +/* XXX 3-byte hole */ +/* 4224 | 8 */ size_t _dl_tls_max_dtv_idx; +/* 4232 | 8 */ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; +/* 4240 | 8 */ size_t _dl_tls_static_nelem; +/* 4248 | 8 */ size_t _dl_tls_static_used; +/* 4256 | 8 */ size_t _dl_tls_static_optional; +/* 4264 | 8 */ void *_dl_initial_dtv; +/* 4272 | 8 */ size_t _dl_tls_generation; +/* 4280 | 8 */ struct dl_scope_free_list *_dl_scope_free_list; +/* 4288 | 16 */ list_t _dl_stack_used; +/* 4304 | 16 */ list_t _dl_stack_user; +/* 4320 | 16 */ list_t _dl_stack_cache; +/* 4336 | 8 */ size_t _dl_stack_cache_actsize; +/* 4344 | 8 */ uintptr_t _dl_in_flight_stack; +/* 4352 | 4 */ int _dl_stack_cache_lock; +/* XXX 4-byte padding */ + + /* total size (bytes): 4360 */ + } +--- struct link_map --- +/* offset | size */ type = struct link_map { +/* 0 | 8 */ Elf64_Addr l_addr; +/* 8 | 8 */ char *l_name; +/* 16 | 8 */ Elf64_Dyn *l_ld; +/* 24 | 8 */ struct link_map *l_next; +/* 32 | 8 */ struct link_map *l_prev; +/* 40 | 8 */ struct link_map *l_real; +/* 48 | 8 */ Lmid_t l_ns; +/* 56 | 8 */ struct libname_list *l_libname; +/* 64 | 664 */ Elf64_Dyn *l_info[83]; +/* 728 | 8 */ const Elf64_Phdr *l_phdr; +/* 736 | 8 */ Elf64_Addr l_entry; +/* 744 | 2 */ Elf64_Half l_phnum; +/* 746 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 752 | 16 */ struct r_scope_elem { +/* 752 | 8 */ struct link_map **r_list; +/* 760 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 768 | 16 */ struct r_scope_elem { +/* 768 | 8 */ struct link_map **r_list; +/* 776 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 784 | 8 */ struct link_map *l_loader; +/* 792 | 8 */ struct r_found_version *l_versions; +/* 800 | 4 */ unsigned int l_nversions; +/* 804 | 4 */ Elf_Symndx l_nbuckets; +/* 808 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 812 | 4 */ Elf32_Word l_gnu_shift; +/* 816 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 824 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 832 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 840 | 4 */ unsigned int l_direct_opencount; +/* 844: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 844: 2 | 4 */ unsigned int l_relocated : 1; +/* 844: 3 | 4 */ unsigned int l_init_called : 1; +/* 844: 4 | 4 */ unsigned int l_global : 1; +/* 844: 5 | 4 */ unsigned int l_reserved : 2; +/* 844: 7 | 4 */ unsigned int l_main_map : 1; +/* 845: 0 | 4 */ unsigned int l_visited : 1; +/* 845: 1 | 4 */ unsigned int l_map_used : 1; +/* 845: 2 | 4 */ unsigned int l_map_done : 1; +/* 845: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 845: 4 | 4 */ unsigned int l_soname_added : 1; +/* 845: 5 | 4 */ unsigned int l_faked : 1; +/* 845: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 845: 7 | 4 */ unsigned int l_auditing : 1; +/* 846: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 846: 1 | 4 */ unsigned int l_removed : 1; +/* 846: 2 | 4 */ unsigned int l_contiguous : 1; +/* 846: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 846: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 846: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 846: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 846: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 847 | 1 */ _Bool l_nodelete_active; +/* 848 | 1 */ _Bool l_nodelete_pending; +/* XXX 7-byte hole */ +/* 856 | 16 */ struct r_search_path_struct { +/* 856 | 8 */ struct r_search_path_elem **dirs; +/* 864 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 872 | 8 */ struct reloc_result *l_reloc_result; +/* 880 | 8 */ Elf64_Versym *l_versyms; +/* 888 | 8 */ const char *l_origin; +/* 896 | 8 */ Elf64_Addr l_map_start; +/* 904 | 8 */ Elf64_Addr l_map_end; +/* 912 | 8 */ Elf64_Addr l_text_end; +/* 920 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 952 | 8 */ size_t l_scope_max; +/* 960 | 8 */ struct r_scope_elem **l_scope; +/* 968 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 984 | 16 */ struct r_file_id { +/* 984 | 8 */ dev_t dev; +/* 992 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 1000 | 16 */ struct r_search_path_struct { +/* 1000 | 8 */ struct r_search_path_elem **dirs; +/* 1008 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 1016 | 8 */ struct link_map **l_initfini; +/* 1024 | 8 */ struct link_map_reldeps *l_reldeps; +/* 1032 | 4 */ unsigned int l_reldepsmax; +/* 1036 | 4 */ unsigned int l_used; +/* 1040 | 4 */ Elf64_Word l_feature_1; +/* 1044 | 4 */ Elf64_Word l_flags_1; +/* 1048 | 4 */ Elf64_Word l_flags; +/* 1052 | 4 */ int l_idx; +/* 1056 | 24 */ struct link_map_machine { +/* 1056 | 8 */ Elf64_Addr plt; +/* 1064 | 8 */ void *tlsdesc_table; +/* 1072 | 1 */ _Bool bti_fail; +/* XXX 7-byte padding */ + + /* total size (bytes): 24 */ + } l_mach; +/* 1080 | 32 */ struct { +/* 1080 | 8 */ const Elf64_Sym *sym; +/* 1088 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 1096 | 8 */ struct link_map *value; +/* 1104 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 1112 | 8 */ void *l_tls_initimage; +/* 1120 | 8 */ size_t l_tls_initimage_size; +/* 1128 | 8 */ size_t l_tls_blocksize; +/* 1136 | 8 */ size_t l_tls_align; +/* 1144 | 8 */ size_t l_tls_firstbyte_offset; +/* 1152 | 8 */ ptrdiff_t l_tls_offset; +/* 1160 | 8 */ size_t l_tls_modid; +/* 1168 | 8 */ size_t l_tls_dtor_count; +/* 1176 | 8 */ Elf64_Addr l_relro_addr; +/* 1184 | 8 */ size_t l_relro_size; +/* 1192 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1200 */ + } +--- struct pthread --- +/* offset | size */ type = struct pthread { +/* 0 | 192 */ union { +/* 8 */ struct { +/* 0 | 4 */ int multiple_threads; +/* 4 | 4 */ int gscope_flag; + + /* total size (bytes): 8 */ + } header; +/* 192 */ void *__padding[24]; + + /* total size (bytes): 192 */ + }; +/* 192 | 16 */ list_t list; +/* 208 | 4 */ pid_t tid; +/* 212 | 4 */ pid_t pid_ununsed; +/* 216 | 8 */ void *robust_prev; +/* 224 | 24 */ struct robust_list_head { +/* 224 | 8 */ void *list; +/* 232 | 8 */ long futex_offset; +/* 240 | 8 */ void *list_op_pending; + + /* total size (bytes): 24 */ + } robust_head; +/* 248 | 8 */ struct _pthread_cleanup_buffer *cleanup; +/* 256 | 8 */ struct pthread_unwind_buf *cleanup_jmp_buf; +/* 264 | 4 */ int cancelhandling; +/* 268 | 4 */ int flags; +/* 272 | 512 */ struct pthread_key_data specific_1stblock[32]; +/* 784 | 256 */ struct pthread_key_data *specific[32]; +/* 1040 | 1 */ _Bool specific_used; +/* 1041 | 1 */ _Bool report_events; +/* 1042 | 1 */ _Bool user_stack; +/* 1043 | 1 */ _Bool stopped_start; +/* 1044 | 4 */ int setup_failed; +/* 1048 | 4 */ int lock; +/* 1052 | 4 */ unsigned int setxid_futex; +/* 1056 | 8 */ struct pthread *joinid; +/* 1064 | 8 */ void *result; +/* 1072 | 4 */ struct sched_param { +/* 1072 | 4 */ int sched_priority; + + /* total size (bytes): 4 */ + } schedparam; +/* 1076 | 4 */ int schedpolicy; +/* 1080 | 8 */ void *(*start_routine)(void *); +/* 1088 | 8 */ void *arg; +/* 1096 | 24 */ td_eventbuf_t eventbuf; +/* 1120 | 8 */ struct pthread *nextevent; +/* XXX 8-byte hole */ +/* 1136 | 32 */ struct _Unwind_Exception { +/* 1136 | 32 */ union { +/* 32 */ struct { +/* 1136 | 8 */ _Unwind_Exception_Class exception_class; +/* 1144 | 8 */ _Unwind_Exception_Cleanup_Fn exception_cleanup; +/* 1152 | 8 */ _Unwind_Word private_1; +/* 1160 | 8 */ _Unwind_Word private_2; + + /* total size (bytes): 32 */ + }; +/* 16 */ _Unwind_Word unwind_exception_align[2]; + + /* total size (bytes): 32 */ + }; + + /* total size (bytes): 32 */ + } exc; +/* 1168 | 8 */ void *stackblock; +/* 1176 | 8 */ size_t stackblock_size; +/* 1184 | 8 */ size_t guardsize; +/* 1192 | 8 */ size_t reported_guardsize; +/* 1200 | 8 */ struct priority_protection_data *tpp; +/* 1208 | 568 */ struct __res_state { +/* 1208 | 4 */ int retrans; +/* 1212 | 4 */ int retry; +/* 1216 | 8 */ unsigned long options; +/* 1224 | 4 */ int nscount; +/* 1228 | 48 */ struct sockaddr_in nsaddr_list[3]; +/* 1276 | 2 */ unsigned short id; +/* XXX 2-byte hole */ +/* 1280 | 56 */ char *dnsrch[7]; +/* 1336 | 256 */ char defdname[256]; +/* 1592 | 8 */ unsigned long pfcode; +/* 1600: 0 | 4 */ unsigned int ndots : 4; +/* 1600: 4 | 4 */ unsigned int nsort : 4; +/* 1601: 0 | 4 */ unsigned int ipv6_unavail : 1; +/* 1601: 1 | 4 */ unsigned int unused : 23; +/* 1604 | 80 */ struct { +/* 0 | 4 */ struct in_addr addr; +/* 4 | 4 */ uint32_t mask; + } sort_list[10]; +/* XXX 4-byte hole */ +/* 1688 | 8 */ void *__glibc_unused_qhook; +/* 1696 | 8 */ void *__glibc_unused_rhook; +/* 1704 | 4 */ int res_h_errno; +/* 1708 | 4 */ int _vcsock; +/* 1712 | 4 */ unsigned int _flags; +/* XXX 4-byte hole */ +/* 1720 | 56 */ union { +/* 52 */ char pad[52]; +/* 56 */ struct { +/* 1720 | 2 */ uint16_t nscount; +/* 1722 | 6 */ uint16_t nsmap[3]; +/* 1728 | 12 */ int nssocks[3]; +/* 1740 | 2 */ uint16_t nscount6; +/* 1742 | 2 */ uint16_t nsinit; +/* 1744 | 24 */ struct sockaddr_in6 *nsaddrs[3]; +/* 1768 | 8 */ unsigned long long __glibc_extension_index; + + /* total size (bytes): 56 */ + } _ext; + + /* total size (bytes): 56 */ + } _u; + + /* total size (bytes): 568 */ + } res; +/* 1776 | 128 */ sigset_t sigmask; +/* 1904 | 1 */ _Bool c11; +/* 1905 | 1 */ _Bool exiting; +/* XXX 2-byte hole */ +/* 1908 | 4 */ int exit_lock; +/* 1912 | 16 */ struct tls_internal_t { +/* 1912 | 8 */ char *strsignal_buf; +/* 1920 | 8 */ char *strerror_l_buf; + + /* total size (bytes): 16 */ + } tls_state; +/* XXX 24-byte hole */ +/* 1952 | 32 */ union { +/* 24 */ struct { +/* 1952 | 4 */ uint32_t cpu_id_start; +/* 1956 | 4 */ uint32_t cpu_id; +/* 1960 | 8 */ uint64_t rseq_cs; +/* 1968 | 4 */ uint32_t flags; +/* XXX 4-byte padding */ + + /* total size (bytes): 24 */ + }; +/* 32 */ char pad[32]; + + /* total size (bytes): 32 */ + } rseq_area; + + /* total size (bytes): 1984 */ + } diff --git a/ld-so-abi-i386.baseline b/ld-so-abi-i386.baseline new file mode 100644 index 0000000..97c85ca --- /dev/null +++ b/ld-so-abi-i386.baseline @@ -0,0 +1,568 @@ +--- _rtld_global_ro --- +/* offset | size */ type = struct rtld_global_ro { +/* 0 | 4 */ int _dl_debug_mask; +/* 4 | 4 */ unsigned int _dl_osversion; +/* 8 | 4 */ const char *_dl_platform; +/* 12 | 4 */ size_t _dl_platformlen; +/* 16 | 4 */ size_t _dl_pagesize; +/* 20 | 4 */ size_t _dl_minsigstacksize; +/* 24 | 4 */ int _dl_inhibit_cache; +/* 28 | 8 */ struct r_scope_elem { +/* 28 | 4 */ struct link_map **r_list; +/* 32 | 4 */ unsigned int r_nlist; + + /* total size (bytes): 8 */ + } _dl_initial_searchlist; +/* 36 | 4 */ int _dl_clktck; +/* 40 | 4 */ int _dl_verbose; +/* 44 | 4 */ int _dl_debug_fd; +/* 48 | 4 */ int _dl_lazy; +/* 52 | 4 */ int _dl_bind_not; +/* 56 | 4 */ int _dl_dynamic_weak; +/* 60 | 2 */ fpu_control_t _dl_fpu_control; +/* XXX 2-byte hole */ +/* 64 | 4 */ int _dl_correct_cache_id; +/* 68 | 8 */ uint64_t _dl_hwcap; +/* 76 | 4 */ Elf32_auxv_t *_dl_auxv; +/* 80 | 396 */ struct cpu_features { +/* 80 | 20 */ struct cpu_features_basic { +/* 80 | 4 */ enum cpu_features_kind kind; +/* 84 | 4 */ int max_cpuid; +/* 88 | 4 */ unsigned int family; +/* 92 | 4 */ unsigned int model; +/* 96 | 4 */ unsigned int stepping; + + /* total size (bytes): 20 */ + } basic; +/* 100 | 288 */ struct cpuid_feature_internal features[9]; +/* 388 | 4 */ unsigned int preferred[1]; +/* 392 | 4 */ unsigned int isa_1; +/* 396 | 4 */ unsigned long xsave_state_size; +/* 400 | 4 */ unsigned int xsave_state_full_size; +/* 404 | 4 */ unsigned long data_cache_size; +/* 408 | 4 */ unsigned long shared_cache_size; +/* 412 | 4 */ unsigned long non_temporal_threshold; +/* 416 | 4 */ unsigned long rep_movsb_threshold; +/* 420 | 4 */ unsigned long rep_movsb_stop_threshold; +/* 424 | 4 */ unsigned long rep_stosb_threshold; +/* 428 | 4 */ unsigned long level1_icache_size; +/* 432 | 4 */ unsigned long level1_icache_linesize; +/* 436 | 4 */ unsigned long level1_dcache_size; +/* 440 | 4 */ unsigned long level1_dcache_assoc; +/* 444 | 4 */ unsigned long level1_dcache_linesize; +/* 448 | 4 */ unsigned long level2_cache_size; +/* 452 | 4 */ unsigned long level2_cache_assoc; +/* 456 | 4 */ unsigned long level2_cache_linesize; +/* 460 | 4 */ unsigned long level3_cache_size; +/* 464 | 4 */ unsigned long level3_cache_assoc; +/* 468 | 4 */ unsigned long level3_cache_linesize; +/* 472 | 4 */ unsigned long level4_cache_size; + + /* total size (bytes): 396 */ + } _dl_x86_cpu_features; +/* 476 | 27 */ const char _dl_x86_hwcap_flags[3][9]; +/* 503 | 36 */ const char _dl_x86_platforms[4][9]; +/* 539 | 256 */ const char _dl_x86_cap_flags[32][8]; +/* XXX 1-byte hole */ +/* 796 | 4 */ const char *_dl_inhibit_rpath; +/* 800 | 4 */ const char *_dl_origin_path; +/* 804 | 4 */ Elf32_Addr _dl_use_load_bias; +/* 808 | 4 */ size_t _dl_tls_static_size; +/* 812 | 4 */ size_t _dl_tls_static_align; +/* 816 | 4 */ size_t _dl_tls_static_surplus; +/* 820 | 4 */ const char *_dl_profile; +/* 824 | 4 */ const char *_dl_profile_output; +/* 828 | 4 */ const char *_dl_trace_prelink; +/* 832 | 4 */ struct link_map *_dl_trace_prelink_map; +/* 836 | 4 */ struct r_search_path_elem *_dl_init_all_dirs; +/* 840 | 4 */ uintptr_t _dl_sysinfo; +/* 844 | 4 */ const Elf32_Ehdr *_dl_sysinfo_dso; +/* 848 | 4 */ struct link_map *_dl_sysinfo_map; +/* 852 | 4 */ int (*_dl_vdso_clock_gettime)(clockid_t, struct timespec *); +/* 856 | 4 */ int (*_dl_vdso_clock_gettime64)(clockid_t, struct __timespec64 *); +/* 860 | 4 */ int (*_dl_vdso_gettimeofday)(struct timeval *, void *); +/* 864 | 4 */ time_t (*_dl_vdso_time)(time_t *); +/* 868 | 4 */ int (*_dl_vdso_clock_getres)(clockid_t, struct timespec *); +/* 872 | 8 */ uint64_t _dl_hwcap2; +/* 880 | 4 */ enum dso_sort_algorithm _dl_dso_sort_algo; +/* 884 | 4 */ void (*_dl_debug_printf)(const char *, ...); +/* 888 | 4 */ void (*_dl_mcount)(Elf32_Addr, Elf32_Addr); +/* 892 | 4 */ lookup_t (*_dl_lookup_symbol_x)(const char *, struct link_map *, const Elf32_Sym **, struct r_scope_elem **, const struct r_found_version *, int, int, struct link_map *); +/* 896 | 4 */ void *(*_dl_open)(const char *, int, const void *, Lmid_t, int, char **, char **); +/* 900 | 4 */ void (*_dl_close)(void *); +/* 904 | 4 */ int (*_dl_catch_error)(const char **, const char **, _Bool *, void (*)(void *), void *); +/* 908 | 4 */ void (*_dl_error_free)(void *); +/* 912 | 4 */ void *(*_dl_tls_get_addr_soft)(struct link_map *); +/* 916 | 4 */ int (*_dl_discover_osversion)(void); +/* 920 | 4 */ const struct dlfcn_hook *_dl_dlfcn_hook; +/* 924 | 4 */ struct audit_ifaces *_dl_audit; +/* 928 | 4 */ unsigned int _dl_naudit; + + /* total size (bytes): 932 */ + } +--- _rtld_global --- +/* offset | size */ type = struct rtld_global { +/* 0 | 1344 */ struct link_namespaces _dl_ns[16]; +/* 1344 | 4 */ size_t _dl_nns; +/* 1348 | 24 */ __rtld_lock_recursive_t _dl_load_lock; +/* 1372 | 24 */ __rtld_lock_recursive_t _dl_load_write_lock; +/* 1396 | 24 */ __rtld_lock_recursive_t _dl_load_tls_lock; +/* 1420 | 8 */ unsigned long long _dl_load_adds; +/* 1428 | 4 */ struct link_map *_dl_initfirst; +/* 1432 | 4 */ struct link_map *_dl_profile_map; +/* 1436 | 4 */ unsigned long _dl_num_relocations; +/* 1440 | 4 */ unsigned long _dl_num_cache_relocations; +/* 1444 | 4 */ struct r_search_path_elem *_dl_all_dirs; +/* 1448 | 620 */ struct link_map { +/* 1448 | 4 */ Elf32_Addr l_addr; +/* 1452 | 4 */ char *l_name; +/* 1456 | 4 */ Elf32_Dyn *l_ld; +/* 1460 | 4 */ struct link_map *l_next; +/* 1464 | 4 */ struct link_map *l_prev; +/* 1468 | 4 */ struct link_map *l_real; +/* 1472 | 4 */ Lmid_t l_ns; +/* 1476 | 4 */ struct libname_list *l_libname; +/* 1480 | 308 */ Elf32_Dyn *l_info[77]; +/* 1788 | 4 */ const Elf32_Phdr *l_phdr; +/* 1792 | 4 */ Elf32_Addr l_entry; +/* 1796 | 2 */ Elf32_Half l_phnum; +/* 1798 | 2 */ Elf32_Half l_ldnum; +/* 1800 | 8 */ struct r_scope_elem { +/* 1800 | 4 */ struct link_map **r_list; +/* 1804 | 4 */ unsigned int r_nlist; + + /* total size (bytes): 8 */ + } l_searchlist; +/* 1808 | 8 */ struct r_scope_elem { +/* 1808 | 4 */ struct link_map **r_list; +/* 1812 | 4 */ unsigned int r_nlist; + + /* total size (bytes): 8 */ + } l_symbolic_searchlist; +/* 1816 | 4 */ struct link_map *l_loader; +/* 1820 | 4 */ struct r_found_version *l_versions; +/* 1824 | 4 */ unsigned int l_nversions; +/* 1828 | 4 */ Elf_Symndx l_nbuckets; +/* 1832 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 1836 | 4 */ Elf32_Word l_gnu_shift; +/* 1840 | 4 */ const Elf32_Addr *l_gnu_bitmask; +/* 1844 | 4 */ union { +/* 4 */ const Elf32_Word *l_gnu_buckets; +/* 4 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 4 */ + }; +/* 1848 | 4 */ union { +/* 4 */ const Elf32_Word *l_gnu_chain_zero; +/* 4 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 4 */ + }; +/* 1852 | 4 */ unsigned int l_direct_opencount; +/* 1856: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 1856: 2 | 4 */ unsigned int l_relocated : 1; +/* 1856: 3 | 4 */ unsigned int l_init_called : 1; +/* 1856: 4 | 4 */ unsigned int l_global : 1; +/* 1856: 5 | 4 */ unsigned int l_reserved : 2; +/* 1856: 7 | 4 */ unsigned int l_main_map : 1; +/* 1857: 0 | 4 */ unsigned int l_visited : 1; +/* 1857: 1 | 4 */ unsigned int l_map_used : 1; +/* 1857: 2 | 4 */ unsigned int l_map_done : 1; +/* 1857: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 1857: 4 | 4 */ unsigned int l_soname_added : 1; +/* 1857: 5 | 4 */ unsigned int l_faked : 1; +/* 1857: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 1857: 7 | 4 */ unsigned int l_auditing : 1; +/* 1858: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 1858: 1 | 4 */ unsigned int l_removed : 1; +/* 1858: 2 | 4 */ unsigned int l_contiguous : 1; +/* 1858: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 1858: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 1858: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 1858: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 1858: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 1859 | 1 */ _Bool l_nodelete_active; +/* 1860 | 1 */ _Bool l_nodelete_pending; +/* 1861: 0 | 4 */ enum {lc_property_unknown, lc_property_none, lc_property_valid} l_property : 2; +/* XXX 6-bit hole */ +/* XXX 2-byte hole */ +/* 1864 | 4 */ unsigned int l_x86_feature_1_and; +/* 1868 | 4 */ unsigned int l_x86_isa_1_needed; +/* 1872 | 8 */ struct r_search_path_struct { +/* 1872 | 4 */ struct r_search_path_elem **dirs; +/* 1876 | 4 */ int malloced; + + /* total size (bytes): 8 */ + } l_rpath_dirs; +/* 1880 | 4 */ struct reloc_result *l_reloc_result; +/* 1884 | 4 */ Elf32_Versym *l_versyms; +/* 1888 | 4 */ const char *l_origin; +/* 1892 | 4 */ Elf32_Addr l_map_start; +/* 1896 | 4 */ Elf32_Addr l_map_end; +/* 1900 | 4 */ Elf32_Addr l_text_end; +/* 1904 | 16 */ struct r_scope_elem *l_scope_mem[4]; +/* 1920 | 4 */ size_t l_scope_max; +/* 1924 | 4 */ struct r_scope_elem **l_scope; +/* 1928 | 8 */ struct r_scope_elem *l_local_scope[2]; +/* 1936 | 16 */ struct r_file_id { +/* 1936 | 8 */ dev_t dev; +/* 1944 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 1952 | 8 */ struct r_search_path_struct { +/* 1952 | 4 */ struct r_search_path_elem **dirs; +/* 1956 | 4 */ int malloced; + + /* total size (bytes): 8 */ + } l_runpath_dirs; +/* 1960 | 4 */ struct link_map **l_initfini; +/* 1964 | 4 */ struct link_map_reldeps *l_reldeps; +/* 1968 | 4 */ unsigned int l_reldepsmax; +/* 1972 | 4 */ unsigned int l_used; +/* 1976 | 4 */ Elf32_Word l_feature_1; +/* 1980 | 4 */ Elf32_Word l_flags_1; +/* 1984 | 4 */ Elf32_Word l_flags; +/* 1988 | 4 */ int l_idx; +/* 1992 | 12 */ struct link_map_machine { +/* 1992 | 4 */ Elf32_Addr plt; +/* 1996 | 4 */ Elf32_Addr gotplt; +/* 2000 | 4 */ void *tlsdesc_table; + + /* total size (bytes): 12 */ + } l_mach; +/* 2004 | 16 */ struct { +/* 2004 | 4 */ const Elf32_Sym *sym; +/* 2008 | 4 */ int type_class; +/* 2012 | 4 */ struct link_map *value; +/* 2016 | 4 */ const Elf32_Sym *ret; + + /* total size (bytes): 16 */ + } l_lookup_cache; +/* 2020 | 4 */ void *l_tls_initimage; +/* 2024 | 4 */ size_t l_tls_initimage_size; +/* 2028 | 4 */ size_t l_tls_blocksize; +/* 2032 | 4 */ size_t l_tls_align; +/* 2036 | 4 */ size_t l_tls_firstbyte_offset; +/* 2040 | 4 */ ptrdiff_t l_tls_offset; +/* 2044 | 4 */ size_t l_tls_modid; +/* 2048 | 4 */ size_t l_tls_dtor_count; +/* 2052 | 4 */ Elf32_Addr l_relro_addr; +/* 2056 | 4 */ size_t l_relro_size; +/* 2060 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 620 */ + } _dl_rtld_map; +/* 2068 | 128 */ struct auditstate _dl_rtld_auditstate[16]; +/* 2196 | 4 */ unsigned int _dl_x86_feature_1; +/* 2200 | 4 */ struct dl_x86_feature_control { +/* 2200: 0 | 4 */ enum dl_x86_cet_control ibt : 2; +/* 2200: 2 | 4 */ enum dl_x86_cet_control shstk : 2; +/* XXX 4-bit padding */ +/* XXX 3-byte padding */ + + /* total size (bytes): 4 */ + } _dl_x86_feature_control; +/* 2204 | 4 */ Elf32_Word _dl_stack_flags; +/* 2208 | 1 */ _Bool _dl_tls_dtv_gaps; +/* XXX 3-byte hole */ +/* 2212 | 4 */ size_t _dl_tls_max_dtv_idx; +/* 2216 | 4 */ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; +/* 2220 | 4 */ size_t _dl_tls_static_nelem; +/* 2224 | 4 */ size_t _dl_tls_static_used; +/* 2228 | 4 */ size_t _dl_tls_static_optional; +/* 2232 | 4 */ void *_dl_initial_dtv; +/* 2236 | 4 */ size_t _dl_tls_generation; +/* 2240 | 4 */ struct dl_scope_free_list *_dl_scope_free_list; +/* 2244 | 8 */ list_t _dl_stack_used; +/* 2252 | 8 */ list_t _dl_stack_user; +/* 2260 | 8 */ list_t _dl_stack_cache; +/* 2268 | 4 */ size_t _dl_stack_cache_actsize; +/* 2272 | 4 */ uintptr_t _dl_in_flight_stack; +/* 2276 | 4 */ int _dl_stack_cache_lock; + + /* total size (bytes): 2280 */ + } +--- struct link_map --- +/* offset | size */ type = struct link_map { +/* 0 | 4 */ Elf32_Addr l_addr; +/* 4 | 4 */ char *l_name; +/* 8 | 4 */ Elf32_Dyn *l_ld; +/* 12 | 4 */ struct link_map *l_next; +/* 16 | 4 */ struct link_map *l_prev; +/* 20 | 4 */ struct link_map *l_real; +/* 24 | 4 */ Lmid_t l_ns; +/* 28 | 4 */ struct libname_list *l_libname; +/* 32 | 308 */ Elf32_Dyn *l_info[77]; +/* 340 | 4 */ const Elf32_Phdr *l_phdr; +/* 344 | 4 */ Elf32_Addr l_entry; +/* 348 | 2 */ Elf32_Half l_phnum; +/* 350 | 2 */ Elf32_Half l_ldnum; +/* 352 | 8 */ struct r_scope_elem { +/* 352 | 4 */ struct link_map **r_list; +/* 356 | 4 */ unsigned int r_nlist; + + /* total size (bytes): 8 */ + } l_searchlist; +/* 360 | 8 */ struct r_scope_elem { +/* 360 | 4 */ struct link_map **r_list; +/* 364 | 4 */ unsigned int r_nlist; + + /* total size (bytes): 8 */ + } l_symbolic_searchlist; +/* 368 | 4 */ struct link_map *l_loader; +/* 372 | 4 */ struct r_found_version *l_versions; +/* 376 | 4 */ unsigned int l_nversions; +/* 380 | 4 */ Elf_Symndx l_nbuckets; +/* 384 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 388 | 4 */ Elf32_Word l_gnu_shift; +/* 392 | 4 */ const Elf32_Addr *l_gnu_bitmask; +/* 396 | 4 */ union { +/* 4 */ const Elf32_Word *l_gnu_buckets; +/* 4 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 4 */ + }; +/* 400 | 4 */ union { +/* 4 */ const Elf32_Word *l_gnu_chain_zero; +/* 4 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 4 */ + }; +/* 404 | 4 */ unsigned int l_direct_opencount; +/* 408: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 408: 2 | 4 */ unsigned int l_relocated : 1; +/* 408: 3 | 4 */ unsigned int l_init_called : 1; +/* 408: 4 | 4 */ unsigned int l_global : 1; +/* 408: 5 | 4 */ unsigned int l_reserved : 2; +/* 408: 7 | 4 */ unsigned int l_main_map : 1; +/* 409: 0 | 4 */ unsigned int l_visited : 1; +/* 409: 1 | 4 */ unsigned int l_map_used : 1; +/* 409: 2 | 4 */ unsigned int l_map_done : 1; +/* 409: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 409: 4 | 4 */ unsigned int l_soname_added : 1; +/* 409: 5 | 4 */ unsigned int l_faked : 1; +/* 409: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 409: 7 | 4 */ unsigned int l_auditing : 1; +/* 410: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 410: 1 | 4 */ unsigned int l_removed : 1; +/* 410: 2 | 4 */ unsigned int l_contiguous : 1; +/* 410: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 410: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 410: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 410: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 410: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 411 | 1 */ _Bool l_nodelete_active; +/* 412 | 1 */ _Bool l_nodelete_pending; +/* 413: 0 | 4 */ enum {lc_property_unknown, lc_property_none, lc_property_valid} l_property : 2; +/* XXX 6-bit hole */ +/* XXX 2-byte hole */ +/* 416 | 4 */ unsigned int l_x86_feature_1_and; +/* 420 | 4 */ unsigned int l_x86_isa_1_needed; +/* 424 | 8 */ struct r_search_path_struct { +/* 424 | 4 */ struct r_search_path_elem **dirs; +/* 428 | 4 */ int malloced; + + /* total size (bytes): 8 */ + } l_rpath_dirs; +/* 432 | 4 */ struct reloc_result *l_reloc_result; +/* 436 | 4 */ Elf32_Versym *l_versyms; +/* 440 | 4 */ const char *l_origin; +/* 444 | 4 */ Elf32_Addr l_map_start; +/* 448 | 4 */ Elf32_Addr l_map_end; +/* 452 | 4 */ Elf32_Addr l_text_end; +/* 456 | 16 */ struct r_scope_elem *l_scope_mem[4]; +/* 472 | 4 */ size_t l_scope_max; +/* 476 | 4 */ struct r_scope_elem **l_scope; +/* 480 | 8 */ struct r_scope_elem *l_local_scope[2]; +/* 488 | 16 */ struct r_file_id { +/* 488 | 8 */ dev_t dev; +/* 496 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 504 | 8 */ struct r_search_path_struct { +/* 504 | 4 */ struct r_search_path_elem **dirs; +/* 508 | 4 */ int malloced; + + /* total size (bytes): 8 */ + } l_runpath_dirs; +/* 512 | 4 */ struct link_map **l_initfini; +/* 516 | 4 */ struct link_map_reldeps *l_reldeps; +/* 520 | 4 */ unsigned int l_reldepsmax; +/* 524 | 4 */ unsigned int l_used; +/* 528 | 4 */ Elf32_Word l_feature_1; +/* 532 | 4 */ Elf32_Word l_flags_1; +/* 536 | 4 */ Elf32_Word l_flags; +/* 540 | 4 */ int l_idx; +/* 544 | 12 */ struct link_map_machine { +/* 544 | 4 */ Elf32_Addr plt; +/* 548 | 4 */ Elf32_Addr gotplt; +/* 552 | 4 */ void *tlsdesc_table; + + /* total size (bytes): 12 */ + } l_mach; +/* 556 | 16 */ struct { +/* 556 | 4 */ const Elf32_Sym *sym; +/* 560 | 4 */ int type_class; +/* 564 | 4 */ struct link_map *value; +/* 568 | 4 */ const Elf32_Sym *ret; + + /* total size (bytes): 16 */ + } l_lookup_cache; +/* 572 | 4 */ void *l_tls_initimage; +/* 576 | 4 */ size_t l_tls_initimage_size; +/* 580 | 4 */ size_t l_tls_blocksize; +/* 584 | 4 */ size_t l_tls_align; +/* 588 | 4 */ size_t l_tls_firstbyte_offset; +/* 592 | 4 */ ptrdiff_t l_tls_offset; +/* 596 | 4 */ size_t l_tls_modid; +/* 600 | 4 */ size_t l_tls_dtor_count; +/* 604 | 4 */ Elf32_Addr l_relro_addr; +/* 608 | 4 */ size_t l_relro_size; +/* 612 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 620 */ + } +--- struct pthread --- +/* offset | size */ type = struct pthread { +/* 0 | 96 */ union { +/* 56 */ tcbhead_t header; +/* 96 */ void *__padding[24]; + + /* total size (bytes): 96 */ + }; +/* 96 | 8 */ list_t list; +/* 104 | 4 */ pid_t tid; +/* 108 | 4 */ pid_t pid_ununsed; +/* 112 | 12 */ union { +/* 4 */ __pthread_slist_t robust_list; +/* 12 */ struct robust_list_head { +/* 112 | 4 */ void *list; +/* 116 | 4 */ long futex_offset; +/* 120 | 4 */ void *list_op_pending; + + /* total size (bytes): 12 */ + } robust_head; + + /* total size (bytes): 12 */ + }; +/* 124 | 4 */ struct _pthread_cleanup_buffer *cleanup; +/* 128 | 4 */ struct pthread_unwind_buf *cleanup_jmp_buf; +/* 132 | 4 */ int cancelhandling; +/* 136 | 4 */ int flags; +/* 140 | 256 */ struct pthread_key_data specific_1stblock[32]; +/* 396 | 128 */ struct pthread_key_data *specific[32]; +/* 524 | 1 */ _Bool specific_used; +/* 525 | 1 */ _Bool report_events; +/* 526 | 1 */ _Bool user_stack; +/* 527 | 1 */ _Bool stopped_start; +/* 528 | 4 */ int setup_failed; +/* 532 | 4 */ int lock; +/* 536 | 4 */ unsigned int setxid_futex; +/* 540 | 8 */ hp_timing_t cpuclock_offset_ununsed; +/* 548 | 4 */ struct pthread *joinid; +/* 552 | 4 */ void *result; +/* 556 | 4 */ struct sched_param { +/* 556 | 4 */ int sched_priority; + + /* total size (bytes): 4 */ + } schedparam; +/* 560 | 4 */ int schedpolicy; +/* 564 | 4 */ void *(*start_routine)(void *); +/* 568 | 4 */ void *arg; +/* 572 | 16 */ td_eventbuf_t eventbuf; +/* 588 | 4 */ struct pthread *nextevent; +/* 592 | 24 */ struct _Unwind_Exception { +/* 592 | 24 */ union { +/* 20 */ struct { +/* 592 | 8 */ _Unwind_Exception_Class exception_class; +/* 600 | 4 */ _Unwind_Exception_Cleanup_Fn exception_cleanup; +/* 604 | 4 */ _Unwind_Word private_1; +/* 608 | 4 */ _Unwind_Word private_2; + + /* total size (bytes): 20 */ + }; +/* 8 */ _Unwind_Word unwind_exception_align[2]; + + /* total size (bytes): 24 */ + }; + + /* total size (bytes): 24 */ + } exc; +/* 616 | 4 */ void *stackblock; +/* 620 | 4 */ size_t stackblock_size; +/* 624 | 4 */ size_t guardsize; +/* 628 | 4 */ size_t reported_guardsize; +/* 632 | 4 */ struct priority_protection_data *tpp; +/* 636 | 512 */ struct __res_state { +/* 636 | 4 */ int retrans; +/* 640 | 4 */ int retry; +/* 644 | 4 */ unsigned long options; +/* 648 | 4 */ int nscount; +/* 652 | 48 */ struct sockaddr_in nsaddr_list[3]; +/* 700 | 2 */ unsigned short id; +/* XXX 2-byte hole */ +/* 704 | 28 */ char *dnsrch[7]; +/* 732 | 256 */ char defdname[256]; +/* 988 | 4 */ unsigned long pfcode; +/* 992: 0 | 4 */ unsigned int ndots : 4; +/* 992: 4 | 4 */ unsigned int nsort : 4; +/* 993: 0 | 4 */ unsigned int ipv6_unavail : 1; +/* 993: 1 | 4 */ unsigned int unused : 23; +/* 996 | 80 */ struct { +/* 0 | 4 */ struct in_addr addr; +/* 4 | 4 */ uint32_t mask; + } sort_list[10]; +/* 1076 | 4 */ void *__glibc_unused_qhook; +/* 1080 | 4 */ void *__glibc_unused_rhook; +/* 1084 | 4 */ int res_h_errno; +/* 1088 | 4 */ int _vcsock; +/* 1092 | 4 */ unsigned int _flags; +/* 1096 | 52 */ union { +/* 52 */ char pad[52]; +/* 44 */ struct { +/* 1096 | 2 */ uint16_t nscount; +/* 1098 | 6 */ uint16_t nsmap[3]; +/* 1104 | 12 */ int nssocks[3]; +/* 1116 | 2 */ uint16_t nscount6; +/* 1118 | 2 */ uint16_t nsinit; +/* 1120 | 12 */ struct sockaddr_in6 *nsaddrs[3]; +/* 1132 | 8 */ unsigned long long __glibc_extension_index; + + /* total size (bytes): 44 */ + } _ext; + + /* total size (bytes): 52 */ + } _u; + + /* total size (bytes): 512 */ + } res; +/* 1148 | 128 */ sigset_t sigmask; +/* 1276 | 1 */ _Bool c11; +/* 1277 | 1 */ _Bool exiting; +/* XXX 2-byte hole */ +/* 1280 | 4 */ int exit_lock; +/* 1284 | 8 */ struct tls_internal_t { +/* 1284 | 4 */ char *strsignal_buf; +/* 1288 | 4 */ char *strerror_l_buf; + + /* total size (bytes): 8 */ + } tls_state; +/* XXX 20-byte hole */ +/* 1312 | 32 */ union { +/* 20 */ struct { +/* 1312 | 4 */ uint32_t cpu_id_start; +/* 1316 | 4 */ uint32_t cpu_id; +/* 1320 | 8 */ uint64_t rseq_cs; +/* 1328 | 4 */ uint32_t flags; + + /* total size (bytes): 20 */ + }; +/* 32 */ char pad[32]; + + /* total size (bytes): 32 */ + } rseq_area; + + /* total size (bytes): 1344 */ + } diff --git a/ld-so-abi-ppc64le.baseline b/ld-so-abi-ppc64le.baseline new file mode 100644 index 0000000..df5a31f --- /dev/null +++ b/ld-so-abi-ppc64le.baseline @@ -0,0 +1,539 @@ +--- _rtld_global_ro --- +/* offset | size */ type = struct rtld_global_ro { +/* 0 | 4 */ int _dl_debug_mask; +/* 4 | 4 */ unsigned int _dl_osversion; +/* 8 | 8 */ const char *_dl_platform; +/* 16 | 8 */ size_t _dl_platformlen; +/* 24 | 8 */ size_t _dl_pagesize; +/* 32 | 8 */ size_t _dl_minsigstacksize; +/* 40 | 4 */ int _dl_inhibit_cache; +/* XXX 4-byte hole */ +/* 48 | 16 */ struct r_scope_elem { +/* 48 | 8 */ struct link_map **r_list; +/* 56 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } _dl_initial_searchlist; +/* 64 | 4 */ int _dl_clktck; +/* 68 | 4 */ int _dl_verbose; +/* 72 | 4 */ int _dl_debug_fd; +/* 76 | 4 */ int _dl_lazy; +/* 80 | 4 */ int _dl_bind_not; +/* 84 | 4 */ int _dl_dynamic_weak; +/* 88 | 4 */ fpu_control_t _dl_fpu_control; +/* 92 | 4 */ int _dl_correct_cache_id; +/* 96 | 8 */ uint64_t _dl_hwcap; +/* 104 | 8 */ Elf64_auxv_t *_dl_auxv; +/* 112 | 24 */ struct cpu_features { +/* 112 | 1 */ _Bool use_cached_memopt; +/* XXX 7-byte hole */ +/* 120 | 8 */ unsigned long hwcap; +/* 128 | 8 */ unsigned long hwcap2; + + /* total size (bytes): 24 */ + } _dl_powerpc_cpu_features; +/* 136 | 960 */ const char _dl_powerpc_cap_flags[64][15]; +/* 1096 | 4 */ int _dl_cache_line_size; +/* XXX 4-byte hole */ +/* 1104 | 8 */ const char *_dl_inhibit_rpath; +/* 1112 | 8 */ const char *_dl_origin_path; +/* 1120 | 8 */ Elf64_Addr _dl_use_load_bias; +/* 1128 | 8 */ size_t _dl_tls_static_size; +/* 1136 | 8 */ size_t _dl_tls_static_align; +/* 1144 | 8 */ size_t _dl_tls_static_surplus; +/* 1152 | 8 */ const char *_dl_profile; +/* 1160 | 8 */ const char *_dl_profile_output; +/* 1168 | 8 */ const char *_dl_trace_prelink; +/* 1176 | 8 */ struct link_map *_dl_trace_prelink_map; +/* 1184 | 8 */ struct r_search_path_elem *_dl_init_all_dirs; +/* 1192 | 8 */ const Elf64_Ehdr *_dl_sysinfo_dso; +/* 1200 | 8 */ struct link_map *_dl_sysinfo_map; +/* 1208 | 8 */ int (*_dl_vdso_clock_gettime64)(clockid_t, struct timespec *); +/* 1216 | 8 */ int (*_dl_vdso_gettimeofday)(struct timeval *, void *); +/* 1224 | 8 */ time_t (*_dl_vdso_time)(time_t *); +/* 1232 | 8 */ int (*_dl_vdso_getcpu)(unsigned int *, unsigned int *, void *); +/* 1240 | 8 */ int (*_dl_vdso_clock_getres_time64)(clockid_t, struct timespec *); +/* 1248 | 8 */ uint64_t (*_dl_vdso_get_tbfreq)(void); +/* 1256 | 8 */ void *_dl_vdso_sigtramp_rt64; +/* 1264 | 8 */ uint64_t _dl_hwcap2; +/* 1272 | 4 */ enum dso_sort_algorithm _dl_dso_sort_algo; +/* XXX 4-byte hole */ +/* 1280 | 8 */ void (*_dl_debug_printf)(const char *, ...); +/* 1288 | 8 */ void (*_dl_mcount)(Elf64_Addr, Elf64_Addr); +/* 1296 | 8 */ lookup_t (*_dl_lookup_symbol_x)(const char *, struct link_map *, const Elf64_Sym **, struct r_scope_elem **, const struct r_found_version *, int, int, struct link_map *); +/* 1304 | 8 */ void *(*_dl_open)(const char *, int, const void *, Lmid_t, int, char **, char **); +/* 1312 | 8 */ void (*_dl_close)(void *); +/* 1320 | 8 */ int (*_dl_catch_error)(const char **, const char **, _Bool *, void (*)(void *), void *); +/* 1328 | 8 */ void (*_dl_error_free)(void *); +/* 1336 | 8 */ void *(*_dl_tls_get_addr_soft)(struct link_map *); +/* 1344 | 8 */ int (*_dl_discover_osversion)(void); +/* 1352 | 8 */ const struct dlfcn_hook *_dl_dlfcn_hook; +/* 1360 | 8 */ struct audit_ifaces *_dl_audit; +/* 1368 | 4 */ unsigned int _dl_naudit; +/* XXX 4-byte padding */ + + /* total size (bytes): 1376 */ + } +--- _rtld_global --- +/* offset | size */ type = struct rtld_global { +/* 0 | 2432 */ struct link_namespaces _dl_ns[16]; +/* 2432 | 8 */ size_t _dl_nns; +/* 2440 | 40 */ __rtld_lock_recursive_t _dl_load_lock; +/* 2480 | 40 */ __rtld_lock_recursive_t _dl_load_write_lock; +/* 2520 | 40 */ __rtld_lock_recursive_t _dl_load_tls_lock; +/* 2560 | 8 */ unsigned long long _dl_load_adds; +/* 2568 | 8 */ struct link_map *_dl_initfirst; +/* 2576 | 8 */ struct link_map *_dl_profile_map; +/* 2584 | 8 */ unsigned long _dl_num_relocations; +/* 2592 | 8 */ unsigned long _dl_num_cache_relocations; +/* 2600 | 8 */ struct r_search_path_elem *_dl_all_dirs; +/* 2608 | 1160 */ struct link_map { +/* 2608 | 8 */ Elf64_Addr l_addr; +/* 2616 | 8 */ char *l_name; +/* 2624 | 8 */ Elf64_Dyn *l_ld; +/* 2632 | 8 */ struct link_map *l_next; +/* 2640 | 8 */ struct link_map *l_prev; +/* 2648 | 8 */ struct link_map *l_real; +/* 2656 | 8 */ Lmid_t l_ns; +/* 2664 | 8 */ struct libname_list *l_libname; +/* 2672 | 648 */ Elf64_Dyn *l_info[81]; +/* 3320 | 8 */ const Elf64_Phdr *l_phdr; +/* 3328 | 8 */ Elf64_Addr l_entry; +/* 3336 | 2 */ Elf64_Half l_phnum; +/* 3338 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 3344 | 16 */ struct r_scope_elem { +/* 3344 | 8 */ struct link_map **r_list; +/* 3352 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 3360 | 16 */ struct r_scope_elem { +/* 3360 | 8 */ struct link_map **r_list; +/* 3368 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 3376 | 8 */ struct link_map *l_loader; +/* 3384 | 8 */ struct r_found_version *l_versions; +/* 3392 | 4 */ unsigned int l_nversions; +/* 3396 | 4 */ Elf_Symndx l_nbuckets; +/* 3400 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 3404 | 4 */ Elf32_Word l_gnu_shift; +/* 3408 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 3416 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 3424 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 3432 | 4 */ unsigned int l_direct_opencount; +/* 3436: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 3436: 2 | 4 */ unsigned int l_relocated : 1; +/* 3436: 3 | 4 */ unsigned int l_init_called : 1; +/* 3436: 4 | 4 */ unsigned int l_global : 1; +/* 3436: 5 | 4 */ unsigned int l_reserved : 2; +/* 3436: 7 | 4 */ unsigned int l_main_map : 1; +/* 3437: 0 | 4 */ unsigned int l_visited : 1; +/* 3437: 1 | 4 */ unsigned int l_map_used : 1; +/* 3437: 2 | 4 */ unsigned int l_map_done : 1; +/* 3437: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 3437: 4 | 4 */ unsigned int l_soname_added : 1; +/* 3437: 5 | 4 */ unsigned int l_faked : 1; +/* 3437: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 3437: 7 | 4 */ unsigned int l_auditing : 1; +/* 3438: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 3438: 1 | 4 */ unsigned int l_removed : 1; +/* 3438: 2 | 4 */ unsigned int l_contiguous : 1; +/* 3438: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 3438: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 3438: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 3438: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 3438: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 3439 | 1 */ _Bool l_nodelete_active; +/* 3440 | 1 */ _Bool l_nodelete_pending; +/* XXX 7-byte hole */ +/* 3448 | 16 */ struct r_search_path_struct { +/* 3448 | 8 */ struct r_search_path_elem **dirs; +/* 3456 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 3464 | 8 */ struct reloc_result *l_reloc_result; +/* 3472 | 8 */ Elf64_Versym *l_versyms; +/* 3480 | 8 */ const char *l_origin; +/* 3488 | 8 */ Elf64_Addr l_map_start; +/* 3496 | 8 */ Elf64_Addr l_map_end; +/* 3504 | 8 */ Elf64_Addr l_text_end; +/* 3512 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 3544 | 8 */ size_t l_scope_max; +/* 3552 | 8 */ struct r_scope_elem **l_scope; +/* 3560 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 3576 | 16 */ struct r_file_id { +/* 3576 | 8 */ dev_t dev; +/* 3584 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 3592 | 16 */ struct r_search_path_struct { +/* 3592 | 8 */ struct r_search_path_elem **dirs; +/* 3600 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 3608 | 8 */ struct link_map **l_initfini; +/* 3616 | 8 */ struct link_map_reldeps *l_reldeps; +/* 3624 | 4 */ unsigned int l_reldepsmax; +/* 3628 | 4 */ unsigned int l_used; +/* 3632 | 4 */ Elf64_Word l_feature_1; +/* 3636 | 4 */ Elf64_Word l_flags_1; +/* 3640 | 4 */ Elf64_Word l_flags; +/* 3644 | 4 */ int l_idx; +/* 3648 | 0 */ struct link_map_machine { + + + /* total size (bytes): 0 */ + } l_mach; +/* 3648 | 32 */ struct { +/* 3648 | 8 */ const Elf64_Sym *sym; +/* 3656 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 3664 | 8 */ struct link_map *value; +/* 3672 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 3680 | 8 */ void *l_tls_initimage; +/* 3688 | 8 */ size_t l_tls_initimage_size; +/* 3696 | 8 */ size_t l_tls_blocksize; +/* 3704 | 8 */ size_t l_tls_align; +/* 3712 | 8 */ size_t l_tls_firstbyte_offset; +/* 3720 | 8 */ ptrdiff_t l_tls_offset; +/* 3728 | 8 */ size_t l_tls_modid; +/* 3736 | 8 */ size_t l_tls_dtor_count; +/* 3744 | 8 */ Elf64_Addr l_relro_addr; +/* 3752 | 8 */ size_t l_relro_size; +/* 3760 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1160 */ + } _dl_rtld_map; +/* 3768 | 256 */ struct auditstate _dl_rtld_auditstate[16]; +/* 4024 | 4 */ Elf64_Word _dl_stack_flags; +/* 4028 | 1 */ _Bool _dl_tls_dtv_gaps; +/* XXX 3-byte hole */ +/* 4032 | 8 */ size_t _dl_tls_max_dtv_idx; +/* 4040 | 8 */ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; +/* 4048 | 8 */ size_t _dl_tls_static_nelem; +/* 4056 | 8 */ size_t _dl_tls_static_used; +/* 4064 | 8 */ size_t _dl_tls_static_optional; +/* 4072 | 8 */ void *_dl_initial_dtv; +/* 4080 | 8 */ size_t _dl_tls_generation; +/* 4088 | 8 */ struct dl_scope_free_list *_dl_scope_free_list; +/* 4096 | 16 */ list_t _dl_stack_used; +/* 4112 | 16 */ list_t _dl_stack_user; +/* 4128 | 16 */ list_t _dl_stack_cache; +/* 4144 | 8 */ size_t _dl_stack_cache_actsize; +/* 4152 | 8 */ uintptr_t _dl_in_flight_stack; +/* 4160 | 4 */ int _dl_stack_cache_lock; +/* XXX 4-byte padding */ + + /* total size (bytes): 4168 */ + } +--- struct link_map --- +/* offset | size */ type = struct link_map { +/* 0 | 8 */ Elf64_Addr l_addr; +/* 8 | 8 */ char *l_name; +/* 16 | 8 */ Elf64_Dyn *l_ld; +/* 24 | 8 */ struct link_map *l_next; +/* 32 | 8 */ struct link_map *l_prev; +/* 40 | 8 */ struct link_map *l_real; +/* 48 | 8 */ Lmid_t l_ns; +/* 56 | 8 */ struct libname_list *l_libname; +/* 64 | 648 */ Elf64_Dyn *l_info[81]; +/* 712 | 8 */ const Elf64_Phdr *l_phdr; +/* 720 | 8 */ Elf64_Addr l_entry; +/* 728 | 2 */ Elf64_Half l_phnum; +/* 730 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 736 | 16 */ struct r_scope_elem { +/* 736 | 8 */ struct link_map **r_list; +/* 744 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 752 | 16 */ struct r_scope_elem { +/* 752 | 8 */ struct link_map **r_list; +/* 760 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 768 | 8 */ struct link_map *l_loader; +/* 776 | 8 */ struct r_found_version *l_versions; +/* 784 | 4 */ unsigned int l_nversions; +/* 788 | 4 */ Elf_Symndx l_nbuckets; +/* 792 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 796 | 4 */ Elf32_Word l_gnu_shift; +/* 800 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 808 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 816 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 824 | 4 */ unsigned int l_direct_opencount; +/* 828: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 828: 2 | 4 */ unsigned int l_relocated : 1; +/* 828: 3 | 4 */ unsigned int l_init_called : 1; +/* 828: 4 | 4 */ unsigned int l_global : 1; +/* 828: 5 | 4 */ unsigned int l_reserved : 2; +/* 828: 7 | 4 */ unsigned int l_main_map : 1; +/* 829: 0 | 4 */ unsigned int l_visited : 1; +/* 829: 1 | 4 */ unsigned int l_map_used : 1; +/* 829: 2 | 4 */ unsigned int l_map_done : 1; +/* 829: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 829: 4 | 4 */ unsigned int l_soname_added : 1; +/* 829: 5 | 4 */ unsigned int l_faked : 1; +/* 829: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 829: 7 | 4 */ unsigned int l_auditing : 1; +/* 830: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 830: 1 | 4 */ unsigned int l_removed : 1; +/* 830: 2 | 4 */ unsigned int l_contiguous : 1; +/* 830: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 830: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 830: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 830: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 830: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 831 | 1 */ _Bool l_nodelete_active; +/* 832 | 1 */ _Bool l_nodelete_pending; +/* XXX 7-byte hole */ +/* 840 | 16 */ struct r_search_path_struct { +/* 840 | 8 */ struct r_search_path_elem **dirs; +/* 848 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 856 | 8 */ struct reloc_result *l_reloc_result; +/* 864 | 8 */ Elf64_Versym *l_versyms; +/* 872 | 8 */ const char *l_origin; +/* 880 | 8 */ Elf64_Addr l_map_start; +/* 888 | 8 */ Elf64_Addr l_map_end; +/* 896 | 8 */ Elf64_Addr l_text_end; +/* 904 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 936 | 8 */ size_t l_scope_max; +/* 944 | 8 */ struct r_scope_elem **l_scope; +/* 952 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 968 | 16 */ struct r_file_id { +/* 968 | 8 */ dev_t dev; +/* 976 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 984 | 16 */ struct r_search_path_struct { +/* 984 | 8 */ struct r_search_path_elem **dirs; +/* 992 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 1000 | 8 */ struct link_map **l_initfini; +/* 1008 | 8 */ struct link_map_reldeps *l_reldeps; +/* 1016 | 4 */ unsigned int l_reldepsmax; +/* 1020 | 4 */ unsigned int l_used; +/* 1024 | 4 */ Elf64_Word l_feature_1; +/* 1028 | 4 */ Elf64_Word l_flags_1; +/* 1032 | 4 */ Elf64_Word l_flags; +/* 1036 | 4 */ int l_idx; +/* 1040 | 0 */ struct link_map_machine { + + + /* total size (bytes): 0 */ + } l_mach; +/* 1040 | 32 */ struct { +/* 1040 | 8 */ const Elf64_Sym *sym; +/* 1048 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 1056 | 8 */ struct link_map *value; +/* 1064 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 1072 | 8 */ void *l_tls_initimage; +/* 1080 | 8 */ size_t l_tls_initimage_size; +/* 1088 | 8 */ size_t l_tls_blocksize; +/* 1096 | 8 */ size_t l_tls_align; +/* 1104 | 8 */ size_t l_tls_firstbyte_offset; +/* 1112 | 8 */ ptrdiff_t l_tls_offset; +/* 1120 | 8 */ size_t l_tls_modid; +/* 1128 | 8 */ size_t l_tls_dtor_count; +/* 1136 | 8 */ Elf64_Addr l_relro_addr; +/* 1144 | 8 */ size_t l_relro_size; +/* 1152 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1160 */ + } +--- struct pthread --- +/* offset | size */ type = struct pthread { +/* 0 | 192 */ union { +/* 8 */ struct { +/* 0 | 4 */ int multiple_threads; +/* 4 | 4 */ int gscope_flag; + + /* total size (bytes): 8 */ + } header; +/* 192 */ void *__padding[24]; + + /* total size (bytes): 192 */ + }; +/* 192 | 16 */ list_t list; +/* 208 | 4 */ pid_t tid; +/* 212 | 4 */ pid_t pid_ununsed; +/* 216 | 8 */ void *robust_prev; +/* 224 | 24 */ struct robust_list_head { +/* 224 | 8 */ void *list; +/* 232 | 8 */ long futex_offset; +/* 240 | 8 */ void *list_op_pending; + + /* total size (bytes): 24 */ + } robust_head; +/* 248 | 8 */ struct _pthread_cleanup_buffer *cleanup; +/* 256 | 8 */ struct pthread_unwind_buf *cleanup_jmp_buf; +/* 264 | 4 */ int cancelhandling; +/* 268 | 4 */ int flags; +/* 272 | 512 */ struct pthread_key_data specific_1stblock[32]; +/* 784 | 256 */ struct pthread_key_data *specific[32]; +/* 1040 | 1 */ _Bool specific_used; +/* 1041 | 1 */ _Bool report_events; +/* 1042 | 1 */ _Bool user_stack; +/* 1043 | 1 */ _Bool stopped_start; +/* 1044 | 4 */ int setup_failed; +/* 1048 | 4 */ int lock; +/* 1052 | 4 */ unsigned int setxid_futex; +/* 1056 | 8 */ hp_timing_t cpuclock_offset_ununsed; +/* 1064 | 8 */ struct pthread *joinid; +/* 1072 | 8 */ void *result; +/* 1080 | 4 */ struct sched_param { +/* 1080 | 4 */ int sched_priority; + + /* total size (bytes): 4 */ + } schedparam; +/* 1084 | 4 */ int schedpolicy; +/* 1088 | 8 */ void *(*start_routine)(void *); +/* 1096 | 8 */ void *arg; +/* 1104 | 24 */ td_eventbuf_t eventbuf; +/* 1128 | 8 */ struct pthread *nextevent; +/* 1136 | 32 */ struct _Unwind_Exception { +/* 1136 | 32 */ union { +/* 32 */ struct { +/* 1136 | 8 */ _Unwind_Exception_Class exception_class; +/* 1144 | 8 */ _Unwind_Exception_Cleanup_Fn exception_cleanup; +/* 1152 | 8 */ _Unwind_Word private_1; +/* 1160 | 8 */ _Unwind_Word private_2; + + /* total size (bytes): 32 */ + }; +/* 16 */ _Unwind_Word unwind_exception_align[2]; + + /* total size (bytes): 32 */ + }; + + /* total size (bytes): 32 */ + } exc; +/* 1168 | 8 */ void *stackblock; +/* 1176 | 8 */ size_t stackblock_size; +/* 1184 | 8 */ size_t guardsize; +/* 1192 | 8 */ size_t reported_guardsize; +/* 1200 | 8 */ struct priority_protection_data *tpp; +/* 1208 | 568 */ struct __res_state { +/* 1208 | 4 */ int retrans; +/* 1212 | 4 */ int retry; +/* 1216 | 8 */ unsigned long options; +/* 1224 | 4 */ int nscount; +/* 1228 | 48 */ struct sockaddr_in nsaddr_list[3]; +/* 1276 | 2 */ unsigned short id; +/* XXX 2-byte hole */ +/* 1280 | 56 */ char *dnsrch[7]; +/* 1336 | 256 */ char defdname[256]; +/* 1592 | 8 */ unsigned long pfcode; +/* 1600: 0 | 4 */ unsigned int ndots : 4; +/* 1600: 4 | 4 */ unsigned int nsort : 4; +/* 1601: 0 | 4 */ unsigned int ipv6_unavail : 1; +/* 1601: 1 | 4 */ unsigned int unused : 23; +/* 1604 | 80 */ struct { +/* 0 | 4 */ struct in_addr addr; +/* 4 | 4 */ uint32_t mask; + } sort_list[10]; +/* XXX 4-byte hole */ +/* 1688 | 8 */ void *__glibc_unused_qhook; +/* 1696 | 8 */ void *__glibc_unused_rhook; +/* 1704 | 4 */ int res_h_errno; +/* 1708 | 4 */ int _vcsock; +/* 1712 | 4 */ unsigned int _flags; +/* XXX 4-byte hole */ +/* 1720 | 56 */ union { +/* 52 */ char pad[52]; +/* 56 */ struct { +/* 1720 | 2 */ uint16_t nscount; +/* 1722 | 6 */ uint16_t nsmap[3]; +/* 1728 | 12 */ int nssocks[3]; +/* 1740 | 2 */ uint16_t nscount6; +/* 1742 | 2 */ uint16_t nsinit; +/* 1744 | 24 */ struct sockaddr_in6 *nsaddrs[3]; +/* 1768 | 8 */ unsigned long long __glibc_extension_index; + + /* total size (bytes): 56 */ + } _ext; + + /* total size (bytes): 56 */ + } _u; + + /* total size (bytes): 568 */ + } res; +/* 1776 | 128 */ sigset_t sigmask; +/* 1904 | 1 */ _Bool c11; +/* 1905 | 1 */ _Bool exiting; +/* XXX 2-byte hole */ +/* 1908 | 4 */ int exit_lock; +/* 1912 | 16 */ struct tls_internal_t { +/* 1912 | 8 */ char *strsignal_buf; +/* 1920 | 8 */ char *strerror_l_buf; + + /* total size (bytes): 16 */ + } tls_state; +/* XXX 24-byte hole */ +/* 1952 | 32 */ union { +/* 24 */ struct { +/* 1952 | 4 */ uint32_t cpu_id_start; +/* 1956 | 4 */ uint32_t cpu_id; +/* 1960 | 8 */ uint64_t rseq_cs; +/* 1968 | 4 */ uint32_t flags; +/* XXX 4-byte padding */ + + /* total size (bytes): 24 */ + }; +/* 32 */ char pad[32]; + + /* total size (bytes): 32 */ + } rseq_area; + + /* total size (bytes): 1984 */ + } diff --git a/ld-so-abi-s390x.baseline b/ld-so-abi-s390x.baseline new file mode 100644 index 0000000..5e54309 --- /dev/null +++ b/ld-so-abi-s390x.baseline @@ -0,0 +1,532 @@ +--- _rtld_global_ro --- +/* offset | size */ type = struct rtld_global_ro { +/* 0 | 4 */ int _dl_debug_mask; +/* 4 | 4 */ unsigned int _dl_osversion; +/* 8 | 8 */ const char *_dl_platform; +/* 16 | 8 */ size_t _dl_platformlen; +/* 24 | 8 */ size_t _dl_pagesize; +/* 32 | 8 */ size_t _dl_minsigstacksize; +/* 40 | 4 */ int _dl_inhibit_cache; +/* XXX 4-byte hole */ +/* 48 | 16 */ struct r_scope_elem { +/* 48 | 8 */ struct link_map **r_list; +/* 56 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } _dl_initial_searchlist; +/* 64 | 4 */ int _dl_clktck; +/* 68 | 4 */ int _dl_verbose; +/* 72 | 4 */ int _dl_debug_fd; +/* 76 | 4 */ int _dl_lazy; +/* 80 | 4 */ int _dl_bind_not; +/* 84 | 4 */ int _dl_dynamic_weak; +/* 88 | 4 */ fpu_control_t _dl_fpu_control; +/* 92 | 4 */ int _dl_correct_cache_id; +/* 96 | 8 */ uint64_t _dl_hwcap; +/* 104 | 8 */ Elf64_auxv_t *_dl_auxv; +/* 112 | 128 */ struct cpu_features { +/* 112 | 8 */ unsigned long hwcap; +/* 120 | 8 */ unsigned long __reserved_hwcap2; +/* 128 | 24 */ unsigned long long stfle_bits[3]; +/* 152 | 88 */ unsigned long long __reserved[11]; + + /* total size (bytes): 128 */ + } _dl_s390_cpu_features; +/* 240 | 8 */ const char *_dl_inhibit_rpath; +/* 248 | 8 */ const char *_dl_origin_path; +/* 256 | 8 */ Elf64_Addr _dl_use_load_bias; +/* 264 | 8 */ size_t _dl_tls_static_size; +/* 272 | 8 */ size_t _dl_tls_static_align; +/* 280 | 8 */ size_t _dl_tls_static_surplus; +/* 288 | 8 */ const char *_dl_profile; +/* 296 | 8 */ const char *_dl_profile_output; +/* 304 | 8 */ const char *_dl_trace_prelink; +/* 312 | 8 */ struct link_map *_dl_trace_prelink_map; +/* 320 | 8 */ struct r_search_path_elem *_dl_init_all_dirs; +/* 328 | 8 */ const Elf64_Ehdr *_dl_sysinfo_dso; +/* 336 | 8 */ struct link_map *_dl_sysinfo_map; +/* 344 | 8 */ int (*_dl_vdso_clock_gettime64)(clockid_t, struct timespec *); +/* 352 | 8 */ int (*_dl_vdso_gettimeofday)(struct timeval *, void *); +/* 360 | 8 */ int (*_dl_vdso_getcpu)(unsigned int *, unsigned int *, void *); +/* 368 | 8 */ int (*_dl_vdso_clock_getres_time64)(clockid_t, struct timespec *); +/* 376 | 8 */ uint64_t _dl_hwcap2; +/* 384 | 4 */ enum dso_sort_algorithm _dl_dso_sort_algo; +/* XXX 4-byte hole */ +/* 392 | 8 */ void (*_dl_debug_printf)(const char *, ...); +/* 400 | 8 */ void (*_dl_mcount)(Elf64_Addr, Elf64_Addr); +/* 408 | 8 */ lookup_t (*_dl_lookup_symbol_x)(const char *, struct link_map *, const Elf64_Sym **, struct r_scope_elem **, const struct r_found_version *, int, int, struct link_map *); +/* 416 | 8 */ void *(*_dl_open)(const char *, int, const void *, Lmid_t, int, char **, char **); +/* 424 | 8 */ void (*_dl_close)(void *); +/* 432 | 8 */ int (*_dl_catch_error)(const char **, const char **, _Bool *, void (*)(void *), void *); +/* 440 | 8 */ void (*_dl_error_free)(void *); +/* 448 | 8 */ void *(*_dl_tls_get_addr_soft)(struct link_map *); +/* 456 | 8 */ int (*_dl_discover_osversion)(void); +/* 464 | 8 */ const struct dlfcn_hook *_dl_dlfcn_hook; +/* 472 | 8 */ struct audit_ifaces *_dl_audit; +/* 480 | 4 */ unsigned int _dl_naudit; +/* XXX 4-byte padding */ + + /* total size (bytes): 488 */ + } +--- _rtld_global --- +/* offset | size */ type = struct rtld_global { +/* 0 | 2432 */ struct link_namespaces _dl_ns[16]; +/* 2432 | 8 */ size_t _dl_nns; +/* 2440 | 40 */ __rtld_lock_recursive_t _dl_load_lock; +/* 2480 | 40 */ __rtld_lock_recursive_t _dl_load_write_lock; +/* 2520 | 40 */ __rtld_lock_recursive_t _dl_load_tls_lock; +/* 2560 | 8 */ unsigned long long _dl_load_adds; +/* 2568 | 8 */ struct link_map *_dl_initfirst; +/* 2576 | 8 */ struct link_map *_dl_profile_map; +/* 2584 | 8 */ unsigned long _dl_num_relocations; +/* 2592 | 8 */ unsigned long _dl_num_cache_relocations; +/* 2600 | 8 */ struct r_search_path_elem *_dl_all_dirs; +/* 2608 | 1152 */ struct link_map { +/* 2608 | 8 */ Elf64_Addr l_addr; +/* 2616 | 8 */ char *l_name; +/* 2624 | 8 */ Elf64_Dyn *l_ld; +/* 2632 | 8 */ struct link_map *l_next; +/* 2640 | 8 */ struct link_map *l_prev; +/* 2648 | 8 */ struct link_map *l_real; +/* 2656 | 8 */ Lmid_t l_ns; +/* 2664 | 8 */ struct libname_list *l_libname; +/* 2672 | 616 */ Elf64_Dyn *l_info[77]; +/* 3288 | 8 */ const Elf64_Phdr *l_phdr; +/* 3296 | 8 */ Elf64_Addr l_entry; +/* 3304 | 2 */ Elf64_Half l_phnum; +/* 3306 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 3312 | 16 */ struct r_scope_elem { +/* 3312 | 8 */ struct link_map **r_list; +/* 3320 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 3328 | 16 */ struct r_scope_elem { +/* 3328 | 8 */ struct link_map **r_list; +/* 3336 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 3344 | 8 */ struct link_map *l_loader; +/* 3352 | 8 */ struct r_found_version *l_versions; +/* 3360 | 4 */ unsigned int l_nversions; +/* XXX 4-byte hole */ +/* 3368 | 8 */ Elf_Symndx l_nbuckets; +/* 3376 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 3380 | 4 */ Elf32_Word l_gnu_shift; +/* 3384 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 3392 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 3400 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 3408 | 4 */ unsigned int l_direct_opencount; +/* 3412: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 3412: 2 | 4 */ unsigned int l_relocated : 1; +/* 3412: 3 | 4 */ unsigned int l_init_called : 1; +/* 3412: 4 | 4 */ unsigned int l_global : 1; +/* 3412: 5 | 4 */ unsigned int l_reserved : 2; +/* 3412: 7 | 4 */ unsigned int l_main_map : 1; +/* 3413: 0 | 4 */ unsigned int l_visited : 1; +/* 3413: 1 | 4 */ unsigned int l_map_used : 1; +/* 3413: 2 | 4 */ unsigned int l_map_done : 1; +/* 3413: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 3413: 4 | 4 */ unsigned int l_soname_added : 1; +/* 3413: 5 | 4 */ unsigned int l_faked : 1; +/* 3413: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 3413: 7 | 4 */ unsigned int l_auditing : 1; +/* 3414: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 3414: 1 | 4 */ unsigned int l_removed : 1; +/* 3414: 2 | 4 */ unsigned int l_contiguous : 1; +/* 3414: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 3414: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 3414: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 3414: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 3414: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 3415 | 1 */ _Bool l_nodelete_active; +/* 3416 | 1 */ _Bool l_nodelete_pending; +/* XXX 7-byte hole */ +/* 3424 | 16 */ struct r_search_path_struct { +/* 3424 | 8 */ struct r_search_path_elem **dirs; +/* 3432 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 3440 | 8 */ struct reloc_result *l_reloc_result; +/* 3448 | 8 */ Elf64_Versym *l_versyms; +/* 3456 | 8 */ const char *l_origin; +/* 3464 | 8 */ Elf64_Addr l_map_start; +/* 3472 | 8 */ Elf64_Addr l_map_end; +/* 3480 | 8 */ Elf64_Addr l_text_end; +/* 3488 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 3520 | 8 */ size_t l_scope_max; +/* 3528 | 8 */ struct r_scope_elem **l_scope; +/* 3536 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 3552 | 16 */ struct r_file_id { +/* 3552 | 8 */ dev_t dev; +/* 3560 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 3568 | 16 */ struct r_search_path_struct { +/* 3568 | 8 */ struct r_search_path_elem **dirs; +/* 3576 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 3584 | 8 */ struct link_map **l_initfini; +/* 3592 | 8 */ struct link_map_reldeps *l_reldeps; +/* 3600 | 4 */ unsigned int l_reldepsmax; +/* 3604 | 4 */ unsigned int l_used; +/* 3608 | 4 */ Elf64_Word l_feature_1; +/* 3612 | 4 */ Elf64_Word l_flags_1; +/* 3616 | 4 */ Elf64_Word l_flags; +/* 3620 | 4 */ int l_idx; +/* 3624 | 16 */ struct link_map_machine { +/* 3624 | 8 */ Elf64_Addr plt; +/* 3632 | 8 */ const Elf64_Rela *jmprel; + + /* total size (bytes): 16 */ + } l_mach; +/* 3640 | 32 */ struct { +/* 3640 | 8 */ const Elf64_Sym *sym; +/* 3648 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 3656 | 8 */ struct link_map *value; +/* 3664 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 3672 | 8 */ void *l_tls_initimage; +/* 3680 | 8 */ size_t l_tls_initimage_size; +/* 3688 | 8 */ size_t l_tls_blocksize; +/* 3696 | 8 */ size_t l_tls_align; +/* 3704 | 8 */ size_t l_tls_firstbyte_offset; +/* 3712 | 8 */ ptrdiff_t l_tls_offset; +/* 3720 | 8 */ size_t l_tls_modid; +/* 3728 | 8 */ size_t l_tls_dtor_count; +/* 3736 | 8 */ Elf64_Addr l_relro_addr; +/* 3744 | 8 */ size_t l_relro_size; +/* 3752 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1152 */ + } _dl_rtld_map; +/* 3760 | 256 */ struct auditstate _dl_rtld_auditstate[16]; +/* 4016 | 4 */ Elf64_Word _dl_stack_flags; +/* 4020 | 1 */ _Bool _dl_tls_dtv_gaps; +/* XXX 3-byte hole */ +/* 4024 | 8 */ size_t _dl_tls_max_dtv_idx; +/* 4032 | 8 */ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; +/* 4040 | 8 */ size_t _dl_tls_static_nelem; +/* 4048 | 8 */ size_t _dl_tls_static_used; +/* 4056 | 8 */ size_t _dl_tls_static_optional; +/* 4064 | 8 */ void *_dl_initial_dtv; +/* 4072 | 8 */ size_t _dl_tls_generation; +/* 4080 | 8 */ struct dl_scope_free_list *_dl_scope_free_list; +/* 4088 | 16 */ list_t _dl_stack_used; +/* 4104 | 16 */ list_t _dl_stack_user; +/* 4120 | 16 */ list_t _dl_stack_cache; +/* 4136 | 8 */ size_t _dl_stack_cache_actsize; +/* 4144 | 8 */ uintptr_t _dl_in_flight_stack; +/* 4152 | 4 */ int _dl_stack_cache_lock; +/* XXX 4-byte padding */ + + /* total size (bytes): 4160 */ + } +--- struct link_map --- +/* offset | size */ type = struct link_map { +/* 0 | 8 */ Elf64_Addr l_addr; +/* 8 | 8 */ char *l_name; +/* 16 | 8 */ Elf64_Dyn *l_ld; +/* 24 | 8 */ struct link_map *l_next; +/* 32 | 8 */ struct link_map *l_prev; +/* 40 | 8 */ struct link_map *l_real; +/* 48 | 8 */ Lmid_t l_ns; +/* 56 | 8 */ struct libname_list *l_libname; +/* 64 | 616 */ Elf64_Dyn *l_info[77]; +/* 680 | 8 */ const Elf64_Phdr *l_phdr; +/* 688 | 8 */ Elf64_Addr l_entry; +/* 696 | 2 */ Elf64_Half l_phnum; +/* 698 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 704 | 16 */ struct r_scope_elem { +/* 704 | 8 */ struct link_map **r_list; +/* 712 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 720 | 16 */ struct r_scope_elem { +/* 720 | 8 */ struct link_map **r_list; +/* 728 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 736 | 8 */ struct link_map *l_loader; +/* 744 | 8 */ struct r_found_version *l_versions; +/* 752 | 4 */ unsigned int l_nversions; +/* XXX 4-byte hole */ +/* 760 | 8 */ Elf_Symndx l_nbuckets; +/* 768 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 772 | 4 */ Elf32_Word l_gnu_shift; +/* 776 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 784 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 792 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 800 | 4 */ unsigned int l_direct_opencount; +/* 804: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 804: 2 | 4 */ unsigned int l_relocated : 1; +/* 804: 3 | 4 */ unsigned int l_init_called : 1; +/* 804: 4 | 4 */ unsigned int l_global : 1; +/* 804: 5 | 4 */ unsigned int l_reserved : 2; +/* 804: 7 | 4 */ unsigned int l_main_map : 1; +/* 805: 0 | 4 */ unsigned int l_visited : 1; +/* 805: 1 | 4 */ unsigned int l_map_used : 1; +/* 805: 2 | 4 */ unsigned int l_map_done : 1; +/* 805: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 805: 4 | 4 */ unsigned int l_soname_added : 1; +/* 805: 5 | 4 */ unsigned int l_faked : 1; +/* 805: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 805: 7 | 4 */ unsigned int l_auditing : 1; +/* 806: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 806: 1 | 4 */ unsigned int l_removed : 1; +/* 806: 2 | 4 */ unsigned int l_contiguous : 1; +/* 806: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 806: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 806: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 806: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 806: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 807 | 1 */ _Bool l_nodelete_active; +/* 808 | 1 */ _Bool l_nodelete_pending; +/* XXX 7-byte hole */ +/* 816 | 16 */ struct r_search_path_struct { +/* 816 | 8 */ struct r_search_path_elem **dirs; +/* 824 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 832 | 8 */ struct reloc_result *l_reloc_result; +/* 840 | 8 */ Elf64_Versym *l_versyms; +/* 848 | 8 */ const char *l_origin; +/* 856 | 8 */ Elf64_Addr l_map_start; +/* 864 | 8 */ Elf64_Addr l_map_end; +/* 872 | 8 */ Elf64_Addr l_text_end; +/* 880 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 912 | 8 */ size_t l_scope_max; +/* 920 | 8 */ struct r_scope_elem **l_scope; +/* 928 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 944 | 16 */ struct r_file_id { +/* 944 | 8 */ dev_t dev; +/* 952 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 960 | 16 */ struct r_search_path_struct { +/* 960 | 8 */ struct r_search_path_elem **dirs; +/* 968 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 976 | 8 */ struct link_map **l_initfini; +/* 984 | 8 */ struct link_map_reldeps *l_reldeps; +/* 992 | 4 */ unsigned int l_reldepsmax; +/* 996 | 4 */ unsigned int l_used; +/* 1000 | 4 */ Elf64_Word l_feature_1; +/* 1004 | 4 */ Elf64_Word l_flags_1; +/* 1008 | 4 */ Elf64_Word l_flags; +/* 1012 | 4 */ int l_idx; +/* 1016 | 16 */ struct link_map_machine { +/* 1016 | 8 */ Elf64_Addr plt; +/* 1024 | 8 */ const Elf64_Rela *jmprel; + + /* total size (bytes): 16 */ + } l_mach; +/* 1032 | 32 */ struct { +/* 1032 | 8 */ const Elf64_Sym *sym; +/* 1040 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 1048 | 8 */ struct link_map *value; +/* 1056 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 1064 | 8 */ void *l_tls_initimage; +/* 1072 | 8 */ size_t l_tls_initimage_size; +/* 1080 | 8 */ size_t l_tls_blocksize; +/* 1088 | 8 */ size_t l_tls_align; +/* 1096 | 8 */ size_t l_tls_firstbyte_offset; +/* 1104 | 8 */ ptrdiff_t l_tls_offset; +/* 1112 | 8 */ size_t l_tls_modid; +/* 1120 | 8 */ size_t l_tls_dtor_count; +/* 1128 | 8 */ Elf64_Addr l_relro_addr; +/* 1136 | 8 */ size_t l_relro_size; +/* 1144 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1152 */ + } +--- struct pthread --- +/* offset | size */ type = struct pthread { +/* 0 | 192 */ union { +/* 64 */ tcbhead_t header; +/* 192 */ void *__padding[24]; + + /* total size (bytes): 192 */ + }; +/* 192 | 16 */ list_t list; +/* 208 | 4 */ pid_t tid; +/* 212 | 4 */ pid_t pid_ununsed; +/* 216 | 8 */ void *robust_prev; +/* 224 | 24 */ struct robust_list_head { +/* 224 | 8 */ void *list; +/* 232 | 8 */ long futex_offset; +/* 240 | 8 */ void *list_op_pending; + + /* total size (bytes): 24 */ + } robust_head; +/* 248 | 8 */ struct _pthread_cleanup_buffer *cleanup; +/* 256 | 8 */ struct pthread_unwind_buf *cleanup_jmp_buf; +/* 264 | 4 */ int cancelhandling; +/* 268 | 4 */ int flags; +/* 272 | 512 */ struct pthread_key_data specific_1stblock[32]; +/* 784 | 256 */ struct pthread_key_data *specific[32]; +/* 1040 | 1 */ _Bool specific_used; +/* 1041 | 1 */ _Bool report_events; +/* 1042 | 1 */ _Bool user_stack; +/* 1043 | 1 */ _Bool stopped_start; +/* 1044 | 4 */ int setup_failed; +/* 1048 | 4 */ int lock; +/* 1052 | 4 */ unsigned int setxid_futex; +/* 1056 | 8 */ hp_timing_t cpuclock_offset_ununsed; +/* 1064 | 8 */ struct pthread *joinid; +/* 1072 | 8 */ void *result; +/* 1080 | 4 */ struct sched_param { +/* 1080 | 4 */ int sched_priority; + + /* total size (bytes): 4 */ + } schedparam; +/* 1084 | 4 */ int schedpolicy; +/* 1088 | 8 */ void *(*start_routine)(void *); +/* 1096 | 8 */ void *arg; +/* 1104 | 24 */ td_eventbuf_t eventbuf; +/* 1128 | 8 */ struct pthread *nextevent; +/* 1136 | 32 */ struct _Unwind_Exception { +/* 1136 | 32 */ union { +/* 32 */ struct { +/* 1136 | 8 */ _Unwind_Exception_Class exception_class; +/* 1144 | 8 */ _Unwind_Exception_Cleanup_Fn exception_cleanup; +/* 1152 | 8 */ _Unwind_Word private_1; +/* 1160 | 8 */ _Unwind_Word private_2; + + /* total size (bytes): 32 */ + }; +/* 16 */ _Unwind_Word unwind_exception_align[2]; + + /* total size (bytes): 32 */ + }; + + /* total size (bytes): 32 */ + } exc; +/* 1168 | 8 */ void *stackblock; +/* 1176 | 8 */ size_t stackblock_size; +/* 1184 | 8 */ size_t guardsize; +/* 1192 | 8 */ size_t reported_guardsize; +/* 1200 | 8 */ struct priority_protection_data *tpp; +/* 1208 | 568 */ struct __res_state { +/* 1208 | 4 */ int retrans; +/* 1212 | 4 */ int retry; +/* 1216 | 8 */ unsigned long options; +/* 1224 | 4 */ int nscount; +/* 1228 | 48 */ struct sockaddr_in nsaddr_list[3]; +/* 1276 | 2 */ unsigned short id; +/* XXX 2-byte hole */ +/* 1280 | 56 */ char *dnsrch[7]; +/* 1336 | 256 */ char defdname[256]; +/* 1592 | 8 */ unsigned long pfcode; +/* 1600: 0 | 4 */ unsigned int ndots : 4; +/* 1600: 4 | 4 */ unsigned int nsort : 4; +/* 1601: 0 | 4 */ unsigned int ipv6_unavail : 1; +/* 1601: 1 | 4 */ unsigned int unused : 23; +/* 1604 | 80 */ struct { +/* 0 | 4 */ struct in_addr addr; +/* 4 | 4 */ uint32_t mask; + } sort_list[10]; +/* XXX 4-byte hole */ +/* 1688 | 8 */ void *__glibc_unused_qhook; +/* 1696 | 8 */ void *__glibc_unused_rhook; +/* 1704 | 4 */ int res_h_errno; +/* 1708 | 4 */ int _vcsock; +/* 1712 | 4 */ unsigned int _flags; +/* XXX 4-byte hole */ +/* 1720 | 56 */ union { +/* 52 */ char pad[52]; +/* 56 */ struct { +/* 1720 | 2 */ uint16_t nscount; +/* 1722 | 6 */ uint16_t nsmap[3]; +/* 1728 | 12 */ int nssocks[3]; +/* 1740 | 2 */ uint16_t nscount6; +/* 1742 | 2 */ uint16_t nsinit; +/* 1744 | 24 */ struct sockaddr_in6 *nsaddrs[3]; +/* 1768 | 8 */ unsigned long long __glibc_extension_index; + + /* total size (bytes): 56 */ + } _ext; + + /* total size (bytes): 56 */ + } _u; + + /* total size (bytes): 568 */ + } res; +/* 1776 | 128 */ sigset_t sigmask; +/* 1904 | 1 */ _Bool c11; +/* 1905 | 1 */ _Bool exiting; +/* XXX 2-byte hole */ +/* 1908 | 4 */ int exit_lock; +/* 1912 | 16 */ struct tls_internal_t { +/* 1912 | 8 */ char *strsignal_buf; +/* 1920 | 8 */ char *strerror_l_buf; + + /* total size (bytes): 16 */ + } tls_state; +/* XXX 24-byte hole */ +/* 1952 | 32 */ union { +/* 24 */ struct { +/* 1952 | 4 */ uint32_t cpu_id_start; +/* 1956 | 4 */ uint32_t cpu_id; +/* 1960 | 8 */ uint64_t rseq_cs; +/* 1968 | 4 */ uint32_t flags; +/* XXX 4-byte padding */ + + /* total size (bytes): 24 */ + }; +/* 32 */ char pad[32]; + + /* total size (bytes): 32 */ + } rseq_area; + + /* total size (bytes): 1984 */ + } diff --git a/ld-so-abi-x86_64.baseline b/ld-so-abi-x86_64.baseline new file mode 100644 index 0000000..5274a5f --- /dev/null +++ b/ld-so-abi-x86_64.baseline @@ -0,0 +1,586 @@ +--- _rtld_global_ro --- +/* offset | size */ type = struct rtld_global_ro { +/* 0 | 4 */ int _dl_debug_mask; +/* 4 | 4 */ unsigned int _dl_osversion; +/* 8 | 8 */ const char *_dl_platform; +/* 16 | 8 */ size_t _dl_platformlen; +/* 24 | 8 */ size_t _dl_pagesize; +/* 32 | 8 */ size_t _dl_minsigstacksize; +/* 40 | 4 */ int _dl_inhibit_cache; +/* XXX 4-byte hole */ +/* 48 | 16 */ struct r_scope_elem { +/* 48 | 8 */ struct link_map **r_list; +/* 56 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } _dl_initial_searchlist; +/* 64 | 4 */ int _dl_clktck; +/* 68 | 4 */ int _dl_verbose; +/* 72 | 4 */ int _dl_debug_fd; +/* 76 | 4 */ int _dl_lazy; +/* 80 | 4 */ int _dl_bind_not; +/* 84 | 4 */ int _dl_dynamic_weak; +/* 88 | 2 */ fpu_control_t _dl_fpu_control; +/* XXX 2-byte hole */ +/* 92 | 4 */ int _dl_correct_cache_id; +/* 96 | 8 */ uint64_t _dl_hwcap; +/* 104 | 8 */ Elf64_auxv_t *_dl_auxv; +/* 112 | 480 */ struct cpu_features { +/* 112 | 20 */ struct cpu_features_basic { +/* 112 | 4 */ enum cpu_features_kind kind; +/* 116 | 4 */ int max_cpuid; +/* 120 | 4 */ unsigned int family; +/* 124 | 4 */ unsigned int model; +/* 128 | 4 */ unsigned int stepping; + + /* total size (bytes): 20 */ + } basic; +/* 132 | 288 */ struct cpuid_feature_internal features[9]; +/* 420 | 4 */ unsigned int preferred[1]; +/* 424 | 4 */ unsigned int isa_1; +/* XXX 4-byte hole */ +/* 432 | 8 */ unsigned long xsave_state_size; +/* 440 | 4 */ unsigned int xsave_state_full_size; +/* XXX 4-byte hole */ +/* 448 | 8 */ unsigned long data_cache_size; +/* 456 | 8 */ unsigned long shared_cache_size; +/* 464 | 8 */ unsigned long non_temporal_threshold; +/* 472 | 8 */ unsigned long rep_movsb_threshold; +/* 480 | 8 */ unsigned long rep_movsb_stop_threshold; +/* 488 | 8 */ unsigned long rep_stosb_threshold; +/* 496 | 8 */ unsigned long level1_icache_size; +/* 504 | 8 */ unsigned long level1_icache_linesize; +/* 512 | 8 */ unsigned long level1_dcache_size; +/* 520 | 8 */ unsigned long level1_dcache_assoc; +/* 528 | 8 */ unsigned long level1_dcache_linesize; +/* 536 | 8 */ unsigned long level2_cache_size; +/* 544 | 8 */ unsigned long level2_cache_assoc; +/* 552 | 8 */ unsigned long level2_cache_linesize; +/* 560 | 8 */ unsigned long level3_cache_size; +/* 568 | 8 */ unsigned long level3_cache_assoc; +/* 576 | 8 */ unsigned long level3_cache_linesize; +/* 584 | 8 */ unsigned long level4_cache_size; + + /* total size (bytes): 480 */ + } _dl_x86_cpu_features; +/* 592 | 27 */ const char _dl_x86_hwcap_flags[3][9]; +/* 619 | 36 */ const char _dl_x86_platforms[4][9]; +/* XXX 1-byte hole */ +/* 656 | 8 */ const char *_dl_inhibit_rpath; +/* 664 | 8 */ const char *_dl_origin_path; +/* 672 | 8 */ Elf64_Addr _dl_use_load_bias; +/* 680 | 8 */ size_t _dl_tls_static_size; +/* 688 | 8 */ size_t _dl_tls_static_align; +/* 696 | 8 */ size_t _dl_tls_static_surplus; +/* 704 | 8 */ const char *_dl_profile; +/* 712 | 8 */ const char *_dl_profile_output; +/* 720 | 8 */ const char *_dl_trace_prelink; +/* 728 | 8 */ struct link_map *_dl_trace_prelink_map; +/* 736 | 8 */ struct r_search_path_elem *_dl_init_all_dirs; +/* 744 | 8 */ const Elf64_Ehdr *_dl_sysinfo_dso; +/* 752 | 8 */ struct link_map *_dl_sysinfo_map; +/* 760 | 8 */ int (*_dl_vdso_clock_gettime64)(clockid_t, struct timespec *); +/* 768 | 8 */ int (*_dl_vdso_gettimeofday)(struct timeval *, void *); +/* 776 | 8 */ time_t (*_dl_vdso_time)(time_t *); +/* 784 | 8 */ int (*_dl_vdso_getcpu)(unsigned int *, unsigned int *, void *); +/* 792 | 8 */ int (*_dl_vdso_clock_getres_time64)(clockid_t, struct timespec *); +/* 800 | 8 */ uint64_t _dl_hwcap2; +/* 808 | 4 */ enum dso_sort_algorithm _dl_dso_sort_algo; +/* XXX 4-byte hole */ +/* 816 | 8 */ void (*_dl_debug_printf)(const char *, ...); +/* 824 | 8 */ void (*_dl_mcount)(Elf64_Addr, Elf64_Addr); +/* 832 | 8 */ lookup_t (*_dl_lookup_symbol_x)(const char *, struct link_map *, const Elf64_Sym **, struct r_scope_elem **, const struct r_found_version *, int, int, struct link_map *); +/* 840 | 8 */ void *(*_dl_open)(const char *, int, const void *, Lmid_t, int, char **, char **); +/* 848 | 8 */ void (*_dl_close)(void *); +/* 856 | 8 */ int (*_dl_catch_error)(const char **, const char **, _Bool *, void (*)(void *), void *); +/* 864 | 8 */ void (*_dl_error_free)(void *); +/* 872 | 8 */ void *(*_dl_tls_get_addr_soft)(struct link_map *); +/* 880 | 8 */ int (*_dl_discover_osversion)(void); +/* 888 | 8 */ const struct dlfcn_hook *_dl_dlfcn_hook; +/* 896 | 8 */ struct audit_ifaces *_dl_audit; +/* 904 | 4 */ unsigned int _dl_naudit; +/* XXX 4-byte padding */ + + /* total size (bytes): 912 */ + } +--- _rtld_global --- +/* offset | size */ type = struct rtld_global { +/* 0 | 2432 */ struct link_namespaces _dl_ns[16]; +/* 2432 | 8 */ size_t _dl_nns; +/* 2440 | 40 */ __rtld_lock_recursive_t _dl_load_lock; +/* 2480 | 40 */ __rtld_lock_recursive_t _dl_load_write_lock; +/* 2520 | 40 */ __rtld_lock_recursive_t _dl_load_tls_lock; +/* 2560 | 8 */ unsigned long long _dl_load_adds; +/* 2568 | 8 */ struct link_map *_dl_initfirst; +/* 2576 | 8 */ struct link_map *_dl_profile_map; +/* 2584 | 8 */ unsigned long _dl_num_relocations; +/* 2592 | 8 */ unsigned long _dl_num_cache_relocations; +/* 2600 | 8 */ struct r_search_path_elem *_dl_all_dirs; +/* 2608 | 1160 */ struct link_map { +/* 2608 | 8 */ Elf64_Addr l_addr; +/* 2616 | 8 */ char *l_name; +/* 2624 | 8 */ Elf64_Dyn *l_ld; +/* 2632 | 8 */ struct link_map *l_next; +/* 2640 | 8 */ struct link_map *l_prev; +/* 2648 | 8 */ struct link_map *l_real; +/* 2656 | 8 */ Lmid_t l_ns; +/* 2664 | 8 */ struct libname_list *l_libname; +/* 2672 | 616 */ Elf64_Dyn *l_info[77]; +/* 3288 | 8 */ const Elf64_Phdr *l_phdr; +/* 3296 | 8 */ Elf64_Addr l_entry; +/* 3304 | 2 */ Elf64_Half l_phnum; +/* 3306 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 3312 | 16 */ struct r_scope_elem { +/* 3312 | 8 */ struct link_map **r_list; +/* 3320 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 3328 | 16 */ struct r_scope_elem { +/* 3328 | 8 */ struct link_map **r_list; +/* 3336 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 3344 | 8 */ struct link_map *l_loader; +/* 3352 | 8 */ struct r_found_version *l_versions; +/* 3360 | 4 */ unsigned int l_nversions; +/* 3364 | 4 */ Elf_Symndx l_nbuckets; +/* 3368 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 3372 | 4 */ Elf32_Word l_gnu_shift; +/* 3376 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 3384 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 3392 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 3400 | 4 */ unsigned int l_direct_opencount; +/* 3404: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 3404: 2 | 4 */ unsigned int l_relocated : 1; +/* 3404: 3 | 4 */ unsigned int l_init_called : 1; +/* 3404: 4 | 4 */ unsigned int l_global : 1; +/* 3404: 5 | 4 */ unsigned int l_reserved : 2; +/* 3404: 7 | 4 */ unsigned int l_main_map : 1; +/* 3405: 0 | 4 */ unsigned int l_visited : 1; +/* 3405: 1 | 4 */ unsigned int l_map_used : 1; +/* 3405: 2 | 4 */ unsigned int l_map_done : 1; +/* 3405: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 3405: 4 | 4 */ unsigned int l_soname_added : 1; +/* 3405: 5 | 4 */ unsigned int l_faked : 1; +/* 3405: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 3405: 7 | 4 */ unsigned int l_auditing : 1; +/* 3406: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 3406: 1 | 4 */ unsigned int l_removed : 1; +/* 3406: 2 | 4 */ unsigned int l_contiguous : 1; +/* 3406: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 3406: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 3406: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 3406: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 3406: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 3407 | 1 */ _Bool l_nodelete_active; +/* 3408 | 1 */ _Bool l_nodelete_pending; +/* 3409: 0 | 4 */ enum {lc_property_unknown, lc_property_none, lc_property_valid} l_property : 2; +/* XXX 6-bit hole */ +/* XXX 2-byte hole */ +/* 3412 | 4 */ unsigned int l_x86_feature_1_and; +/* 3416 | 4 */ unsigned int l_x86_isa_1_needed; +/* XXX 4-byte hole */ +/* 3424 | 16 */ struct r_search_path_struct { +/* 3424 | 8 */ struct r_search_path_elem **dirs; +/* 3432 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 3440 | 8 */ struct reloc_result *l_reloc_result; +/* 3448 | 8 */ Elf64_Versym *l_versyms; +/* 3456 | 8 */ const char *l_origin; +/* 3464 | 8 */ Elf64_Addr l_map_start; +/* 3472 | 8 */ Elf64_Addr l_map_end; +/* 3480 | 8 */ Elf64_Addr l_text_end; +/* 3488 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 3520 | 8 */ size_t l_scope_max; +/* 3528 | 8 */ struct r_scope_elem **l_scope; +/* 3536 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 3552 | 16 */ struct r_file_id { +/* 3552 | 8 */ dev_t dev; +/* 3560 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 3568 | 16 */ struct r_search_path_struct { +/* 3568 | 8 */ struct r_search_path_elem **dirs; +/* 3576 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 3584 | 8 */ struct link_map **l_initfini; +/* 3592 | 8 */ struct link_map_reldeps *l_reldeps; +/* 3600 | 4 */ unsigned int l_reldepsmax; +/* 3604 | 4 */ unsigned int l_used; +/* 3608 | 4 */ Elf64_Word l_feature_1; +/* 3612 | 4 */ Elf64_Word l_flags_1; +/* 3616 | 4 */ Elf64_Word l_flags; +/* 3620 | 4 */ int l_idx; +/* 3624 | 24 */ struct link_map_machine { +/* 3624 | 8 */ Elf64_Addr plt; +/* 3632 | 8 */ Elf64_Addr gotplt; +/* 3640 | 8 */ void *tlsdesc_table; + + /* total size (bytes): 24 */ + } l_mach; +/* 3648 | 32 */ struct { +/* 3648 | 8 */ const Elf64_Sym *sym; +/* 3656 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 3664 | 8 */ struct link_map *value; +/* 3672 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 3680 | 8 */ void *l_tls_initimage; +/* 3688 | 8 */ size_t l_tls_initimage_size; +/* 3696 | 8 */ size_t l_tls_blocksize; +/* 3704 | 8 */ size_t l_tls_align; +/* 3712 | 8 */ size_t l_tls_firstbyte_offset; +/* 3720 | 8 */ ptrdiff_t l_tls_offset; +/* 3728 | 8 */ size_t l_tls_modid; +/* 3736 | 8 */ size_t l_tls_dtor_count; +/* 3744 | 8 */ Elf64_Addr l_relro_addr; +/* 3752 | 8 */ size_t l_relro_size; +/* 3760 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1160 */ + } _dl_rtld_map; +/* 3768 | 256 */ struct auditstate _dl_rtld_auditstate[16]; +/* 4024 | 4 */ unsigned int _dl_x86_feature_1; +/* 4028 | 4 */ struct dl_x86_feature_control { +/* 4028: 0 | 4 */ enum dl_x86_cet_control ibt : 2; +/* 4028: 2 | 4 */ enum dl_x86_cet_control shstk : 2; +/* XXX 4-bit padding */ +/* XXX 3-byte padding */ + + /* total size (bytes): 4 */ + } _dl_x86_feature_control; +/* 4032 | 4 */ Elf64_Word _dl_stack_flags; +/* 4036 | 1 */ _Bool _dl_tls_dtv_gaps; +/* XXX 3-byte hole */ +/* 4040 | 8 */ size_t _dl_tls_max_dtv_idx; +/* 4048 | 8 */ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; +/* 4056 | 8 */ size_t _dl_tls_static_nelem; +/* 4064 | 8 */ size_t _dl_tls_static_used; +/* 4072 | 8 */ size_t _dl_tls_static_optional; +/* 4080 | 8 */ void *_dl_initial_dtv; +/* 4088 | 8 */ size_t _dl_tls_generation; +/* 4096 | 8 */ struct dl_scope_free_list *_dl_scope_free_list; +/* 4104 | 16 */ list_t _dl_stack_used; +/* 4120 | 16 */ list_t _dl_stack_user; +/* 4136 | 16 */ list_t _dl_stack_cache; +/* 4152 | 8 */ size_t _dl_stack_cache_actsize; +/* 4160 | 8 */ uintptr_t _dl_in_flight_stack; +/* 4168 | 4 */ int _dl_stack_cache_lock; +/* XXX 4-byte padding */ + + /* total size (bytes): 4176 */ + } +--- struct link_map --- +/* offset | size */ type = struct link_map { +/* 0 | 8 */ Elf64_Addr l_addr; +/* 8 | 8 */ char *l_name; +/* 16 | 8 */ Elf64_Dyn *l_ld; +/* 24 | 8 */ struct link_map *l_next; +/* 32 | 8 */ struct link_map *l_prev; +/* 40 | 8 */ struct link_map *l_real; +/* 48 | 8 */ Lmid_t l_ns; +/* 56 | 8 */ struct libname_list *l_libname; +/* 64 | 616 */ Elf64_Dyn *l_info[77]; +/* 680 | 8 */ const Elf64_Phdr *l_phdr; +/* 688 | 8 */ Elf64_Addr l_entry; +/* 696 | 2 */ Elf64_Half l_phnum; +/* 698 | 2 */ Elf64_Half l_ldnum; +/* XXX 4-byte hole */ +/* 704 | 16 */ struct r_scope_elem { +/* 704 | 8 */ struct link_map **r_list; +/* 712 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_searchlist; +/* 720 | 16 */ struct r_scope_elem { +/* 720 | 8 */ struct link_map **r_list; +/* 728 | 4 */ unsigned int r_nlist; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_symbolic_searchlist; +/* 736 | 8 */ struct link_map *l_loader; +/* 744 | 8 */ struct r_found_version *l_versions; +/* 752 | 4 */ unsigned int l_nversions; +/* 756 | 4 */ Elf_Symndx l_nbuckets; +/* 760 | 4 */ Elf32_Word l_gnu_bitmask_idxbits; +/* 764 | 4 */ Elf32_Word l_gnu_shift; +/* 768 | 8 */ const Elf64_Addr *l_gnu_bitmask; +/* 776 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_buckets; +/* 8 */ const Elf_Symndx *l_chain; + + /* total size (bytes): 8 */ + }; +/* 784 | 8 */ union { +/* 8 */ const Elf32_Word *l_gnu_chain_zero; +/* 8 */ const Elf_Symndx *l_buckets; + + /* total size (bytes): 8 */ + }; +/* 792 | 4 */ unsigned int l_direct_opencount; +/* 796: 0 | 4 */ enum {lt_executable, lt_library, lt_loaded} l_type : 2; +/* 796: 2 | 4 */ unsigned int l_relocated : 1; +/* 796: 3 | 4 */ unsigned int l_init_called : 1; +/* 796: 4 | 4 */ unsigned int l_global : 1; +/* 796: 5 | 4 */ unsigned int l_reserved : 2; +/* 796: 7 | 4 */ unsigned int l_main_map : 1; +/* 797: 0 | 4 */ unsigned int l_visited : 1; +/* 797: 1 | 4 */ unsigned int l_map_used : 1; +/* 797: 2 | 4 */ unsigned int l_map_done : 1; +/* 797: 3 | 4 */ unsigned int l_phdr_allocated : 1; +/* 797: 4 | 4 */ unsigned int l_soname_added : 1; +/* 797: 5 | 4 */ unsigned int l_faked : 1; +/* 797: 6 | 4 */ unsigned int l_need_tls_init : 1; +/* 797: 7 | 4 */ unsigned int l_auditing : 1; +/* 798: 0 | 4 */ unsigned int l_audit_any_plt : 1; +/* 798: 1 | 4 */ unsigned int l_removed : 1; +/* 798: 2 | 4 */ unsigned int l_contiguous : 1; +/* 798: 3 | 4 */ unsigned int l_symbolic_in_local_scope : 1; +/* 798: 4 | 4 */ unsigned int l_free_initfini : 1; +/* 798: 5 | 4 */ unsigned int l_ld_readonly : 1; +/* 798: 6 | 4 */ unsigned int l_tls_in_slotinfo : 1; +/* 798: 7 | 4 */ unsigned int l_find_object_processed : 1; +/* 799 | 1 */ _Bool l_nodelete_active; +/* 800 | 1 */ _Bool l_nodelete_pending; +/* 801: 0 | 4 */ enum {lc_property_unknown, lc_property_none, lc_property_valid} l_property : 2; +/* XXX 6-bit hole */ +/* XXX 2-byte hole */ +/* 804 | 4 */ unsigned int l_x86_feature_1_and; +/* 808 | 4 */ unsigned int l_x86_isa_1_needed; +/* XXX 4-byte hole */ +/* 816 | 16 */ struct r_search_path_struct { +/* 816 | 8 */ struct r_search_path_elem **dirs; +/* 824 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_rpath_dirs; +/* 832 | 8 */ struct reloc_result *l_reloc_result; +/* 840 | 8 */ Elf64_Versym *l_versyms; +/* 848 | 8 */ const char *l_origin; +/* 856 | 8 */ Elf64_Addr l_map_start; +/* 864 | 8 */ Elf64_Addr l_map_end; +/* 872 | 8 */ Elf64_Addr l_text_end; +/* 880 | 32 */ struct r_scope_elem *l_scope_mem[4]; +/* 912 | 8 */ size_t l_scope_max; +/* 920 | 8 */ struct r_scope_elem **l_scope; +/* 928 | 16 */ struct r_scope_elem *l_local_scope[2]; +/* 944 | 16 */ struct r_file_id { +/* 944 | 8 */ dev_t dev; +/* 952 | 8 */ ino64_t ino; + + /* total size (bytes): 16 */ + } l_file_id; +/* 960 | 16 */ struct r_search_path_struct { +/* 960 | 8 */ struct r_search_path_elem **dirs; +/* 968 | 4 */ int malloced; +/* XXX 4-byte padding */ + + /* total size (bytes): 16 */ + } l_runpath_dirs; +/* 976 | 8 */ struct link_map **l_initfini; +/* 984 | 8 */ struct link_map_reldeps *l_reldeps; +/* 992 | 4 */ unsigned int l_reldepsmax; +/* 996 | 4 */ unsigned int l_used; +/* 1000 | 4 */ Elf64_Word l_feature_1; +/* 1004 | 4 */ Elf64_Word l_flags_1; +/* 1008 | 4 */ Elf64_Word l_flags; +/* 1012 | 4 */ int l_idx; +/* 1016 | 24 */ struct link_map_machine { +/* 1016 | 8 */ Elf64_Addr plt; +/* 1024 | 8 */ Elf64_Addr gotplt; +/* 1032 | 8 */ void *tlsdesc_table; + + /* total size (bytes): 24 */ + } l_mach; +/* 1040 | 32 */ struct { +/* 1040 | 8 */ const Elf64_Sym *sym; +/* 1048 | 4 */ int type_class; +/* XXX 4-byte hole */ +/* 1056 | 8 */ struct link_map *value; +/* 1064 | 8 */ const Elf64_Sym *ret; + + /* total size (bytes): 32 */ + } l_lookup_cache; +/* 1072 | 8 */ void *l_tls_initimage; +/* 1080 | 8 */ size_t l_tls_initimage_size; +/* 1088 | 8 */ size_t l_tls_blocksize; +/* 1096 | 8 */ size_t l_tls_align; +/* 1104 | 8 */ size_t l_tls_firstbyte_offset; +/* 1112 | 8 */ ptrdiff_t l_tls_offset; +/* 1120 | 8 */ size_t l_tls_modid; +/* 1128 | 8 */ size_t l_tls_dtor_count; +/* 1136 | 8 */ Elf64_Addr l_relro_addr; +/* 1144 | 8 */ size_t l_relro_size; +/* 1152 | 8 */ unsigned long long l_serial; + + /* total size (bytes): 1160 */ + } +--- struct pthread --- +/* offset | size */ type = struct pthread { +/* 0 | 704 */ union { +/* 704 */ tcbhead_t header; +/* 192 */ void *__padding[24]; + + /* total size (bytes): 704 */ + }; +/* 704 | 16 */ list_t list; +/* 720 | 4 */ pid_t tid; +/* 724 | 4 */ pid_t pid_ununsed; +/* 728 | 8 */ void *robust_prev; +/* 736 | 24 */ struct robust_list_head { +/* 736 | 8 */ void *list; +/* 744 | 8 */ long futex_offset; +/* 752 | 8 */ void *list_op_pending; + + /* total size (bytes): 24 */ + } robust_head; +/* 760 | 8 */ struct _pthread_cleanup_buffer *cleanup; +/* 768 | 8 */ struct pthread_unwind_buf *cleanup_jmp_buf; +/* 776 | 4 */ int cancelhandling; +/* 780 | 4 */ int flags; +/* 784 | 512 */ struct pthread_key_data specific_1stblock[32]; +/* 1296 | 256 */ struct pthread_key_data *specific[32]; +/* 1552 | 1 */ _Bool specific_used; +/* 1553 | 1 */ _Bool report_events; +/* 1554 | 1 */ _Bool user_stack; +/* 1555 | 1 */ _Bool stopped_start; +/* 1556 | 4 */ int setup_failed; +/* 1560 | 4 */ int lock; +/* 1564 | 4 */ unsigned int setxid_futex; +/* 1568 | 8 */ hp_timing_t cpuclock_offset_ununsed; +/* 1576 | 8 */ struct pthread *joinid; +/* 1584 | 8 */ void *result; +/* 1592 | 4 */ struct sched_param { +/* 1592 | 4 */ int sched_priority; + + /* total size (bytes): 4 */ + } schedparam; +/* 1596 | 4 */ int schedpolicy; +/* 1600 | 8 */ void *(*start_routine)(void *); +/* 1608 | 8 */ void *arg; +/* 1616 | 24 */ td_eventbuf_t eventbuf; +/* 1640 | 8 */ struct pthread *nextevent; +/* 1648 | 32 */ struct _Unwind_Exception { +/* 1648 | 32 */ union { +/* 32 */ struct { +/* 1648 | 8 */ _Unwind_Exception_Class exception_class; +/* 1656 | 8 */ _Unwind_Exception_Cleanup_Fn exception_cleanup; +/* 1664 | 8 */ _Unwind_Word private_1; +/* 1672 | 8 */ _Unwind_Word private_2; + + /* total size (bytes): 32 */ + }; +/* 16 */ _Unwind_Word unwind_exception_align[2]; + + /* total size (bytes): 32 */ + }; + + /* total size (bytes): 32 */ + } exc; +/* 1680 | 8 */ void *stackblock; +/* 1688 | 8 */ size_t stackblock_size; +/* 1696 | 8 */ size_t guardsize; +/* 1704 | 8 */ size_t reported_guardsize; +/* 1712 | 8 */ struct priority_protection_data *tpp; +/* 1720 | 568 */ struct __res_state { +/* 1720 | 4 */ int retrans; +/* 1724 | 4 */ int retry; +/* 1728 | 8 */ unsigned long options; +/* 1736 | 4 */ int nscount; +/* 1740 | 48 */ struct sockaddr_in nsaddr_list[3]; +/* 1788 | 2 */ unsigned short id; +/* XXX 2-byte hole */ +/* 1792 | 56 */ char *dnsrch[7]; +/* 1848 | 256 */ char defdname[256]; +/* 2104 | 8 */ unsigned long pfcode; +/* 2112: 0 | 4 */ unsigned int ndots : 4; +/* 2112: 4 | 4 */ unsigned int nsort : 4; +/* 2113: 0 | 4 */ unsigned int ipv6_unavail : 1; +/* 2113: 1 | 4 */ unsigned int unused : 23; +/* 2116 | 80 */ struct { +/* 0 | 4 */ struct in_addr addr; +/* 4 | 4 */ uint32_t mask; + } sort_list[10]; +/* XXX 4-byte hole */ +/* 2200 | 8 */ void *__glibc_unused_qhook; +/* 2208 | 8 */ void *__glibc_unused_rhook; +/* 2216 | 4 */ int res_h_errno; +/* 2220 | 4 */ int _vcsock; +/* 2224 | 4 */ unsigned int _flags; +/* XXX 4-byte hole */ +/* 2232 | 56 */ union { +/* 52 */ char pad[52]; +/* 56 */ struct { +/* 2232 | 2 */ uint16_t nscount; +/* 2234 | 6 */ uint16_t nsmap[3]; +/* 2240 | 12 */ int nssocks[3]; +/* 2252 | 2 */ uint16_t nscount6; +/* 2254 | 2 */ uint16_t nsinit; +/* 2256 | 24 */ struct sockaddr_in6 *nsaddrs[3]; +/* 2280 | 8 */ unsigned long long __glibc_extension_index; + + /* total size (bytes): 56 */ + } _ext; + + /* total size (bytes): 56 */ + } _u; + + /* total size (bytes): 568 */ + } res; +/* 2288 | 128 */ sigset_t sigmask; +/* 2416 | 1 */ _Bool c11; +/* 2417 | 1 */ _Bool exiting; +/* XXX 2-byte hole */ +/* 2420 | 4 */ int exit_lock; +/* 2424 | 16 */ struct tls_internal_t { +/* 2424 | 8 */ char *strsignal_buf; +/* 2432 | 8 */ char *strerror_l_buf; + + /* total size (bytes): 16 */ + } tls_state; +/* XXX 24-byte hole */ +/* 2464 | 32 */ union { +/* 24 */ struct { +/* 2464 | 4 */ uint32_t cpu_id_start; +/* 2468 | 4 */ uint32_t cpu_id; +/* 2472 | 8 */ uint64_t rseq_cs; +/* 2480 | 4 */ uint32_t flags; +/* XXX 4-byte padding */ + + /* total size (bytes): 24 */ + }; +/* 32 */ char pad[32]; + + /* total size (bytes): 32 */ + } rseq_area; + + /* total size (bytes): 2496 */ + } diff --git a/verify-ld-so-abi.sh b/verify-ld-so-abi.sh new file mode 100644 index 0000000..6b33dd9 --- /dev/null +++ b/verify-ld-so-abi.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# This script verifies the ABI of ld.so by comparing the layout of +# critical data structures against a known baseline for a given architecture. +# +# This is useful to prevent unintentional ABI breaks between releases. +# +# Usage: ./elf/verify-ld-so-abi.sh [--generate-baseline] + +set -euo pipefail + +if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then + echo "Usage: $0 [--generate-baseline]" + exit 1 +fi + +ARCH="$1" +LDSO_PATH="$2" +GENERATE_BASELINE=false +if [ "${3:-}" == "--generate-baseline" ]; then + GENERATE_BASELINE=true +fi + +# The script is expected to be in the 'elf' directory and run from the glibc root. +SCRIPT_DIR="$(dirname "$0")" +BASELINE_DIR="$SCRIPT_DIR" +BASELINE_FILE="$BASELINE_DIR/ld-so-abi-$ARCH.baseline" + +# List of structs and global variables to check in ld.so. +# These are critical for the dynamic linker's internal ABI. +SYMBOLS_TO_CHECK=( + "_rtld_global_ro" + "_rtld_global" + "struct link_map" + "struct pthread" +) + +# Check for dependencies. +if ! command -v gdb &> /dev/null; then + echo "Error: gdb is not installed. Please install it to continue." >&2 + exit 127 +fi + +if [ ! -f "$LDSO_PATH" ]; then + echo "Error: ld.so not found at '$LDSO_PATH'" >&2 + exit 1 +fi + +TEMP_FILE=$(mktemp) +# Ensure the temporary file is cleaned up on script exit. +trap 'rm -f "$TEMP_FILE"' EXIT + +echo "Generating current ABI layout for '$ARCH' from '$LDSO_PATH'..." + +for symbol in "${SYMBOLS_TO_CHECK[@]}"; do + echo "--- $symbol ---" >> "$TEMP_FILE" + # Use ptype/o to get the struct layout with offsets. + # If a symbol does not exist, GDB will exit with an error, which is + # caught by 'set -e'. + gdb -batch -ex "ptype/o $symbol" "$LDSO_PATH" >> "$TEMP_FILE" +done + +if [ "$GENERATE_BASELINE" = true ]; then + echo "Generating new baseline for '$ARCH'..." + mkdir -p "$BASELINE_DIR" + # Atomically move the new baseline into place. + mv "$TEMP_FILE" "$BASELINE_FILE" + echo "Baseline created at $BASELINE_FILE" + # The temp file has been moved, so disable the trap. + trap - EXIT + exit 0 +fi + +# --- Comparison Mode --- + +if [ ! -f "$BASELINE_FILE" ]; then + echo "Error: Baseline file for architecture '$ARCH' does not exist." >&2 + echo "Path: $BASELINE_FILE" >&2 + echo >&2 + echo "To generate a new baseline, run this command with the --generate-baseline flag:" >&2 + echo "$0 $ARCH '$LDSO_PATH' --generate-baseline" >&2 + exit 77 +fi + +echo "Comparing with baseline file: $BASELINE_FILE" + +# Compare the generated layout with the official baseline. +if ! diff -u "$BASELINE_FILE" "$TEMP_FILE"; then + echo >&2 + echo "Error: ABI layout mismatch for '$ARCH' has been detected." >&2 + echo "The layout of structs in '$LDSO_PATH' has changed." >&2 + echo >&2 + echo "If this change is intentional, update the baseline file by running:" >&2 + echo "$0 $ARCH '$LDSO_PATH' --generate-baseline" >&2 + echo "Or by applying the diff using 'patch -R'" + exit 1 +else + echo "OK: ABI layout for '$ARCH' is consistent with the baseline." + exit 0 +fi +