summaryrefslogtreecommitdiffstats
path: root/trunk/src
AgeCommit message (Collapse)Author
2010-07-22Resolve R_MIPS_TLS_DTPMOD32/64 relocationscross_prelink_r174Mark Hatle
2009-09-01 Maciej W. Rozycki <macro@codesourcery.com> Issue #5273 * src/arch-mips.c (mips_prelink_reloc): Resolve R_MIPS_TLS_DTPMOD32 and R_MIPS_TLS_DTPMOD64 relocations in executables.
2010-07-22Fix buffer overrun in load_ld_so_confMark Hatle
2009-04-27 Maciej W. Rozycki <macro@codesourcery.com> Issue #5165 * src/ld-libs.c (load_ld_so_conf): Fix a buffer overrun. Don't record empty paths.
2010-07-22Add local hash calculationsMark Hatle
2009-04-23 Maciej W. Rozycki <macro@codesourcery.com> Issue #5165 * src/ld-lookup.c (rtld_elf_hash): Handle an initial NULL character correctly. Reformat for consistency with rtld_elf_gnu_hash(). 2009-04-23 Maciej W. Rozycki <macro@codesourcery.com> Issue #5165 * src/ld-do-lookup.h (FCT): Remove the hash argument and calculate the value within the function. Call do_lookup_get_first() and do_lookup_get_next() to iterate over symbols. * src/prelink.h (dynamic_info_is_set): Convert macro to a function. Return 1 for success rather than the bit set. * src/ld-libs.h (ldlibs_link_map): Add l_gnu_hash, l_maskword64, l_nmaskwords, l_shift and l_maskwords members. * src/ld-libs.c (create_ldlibs_link_map): Handle the GNU hash. * src/ld-lookup.c (rtld_elf_gnu_hash): New function. (rtld_elf_any_hash): Likewise. (rtld_elf_hash): Move above "ld-do-lookup.h" inclusions. (do_lookup_get_first, do_lookup_get_next): New functions. (rtld_lookup_symbol): Remove hash calculation. (rtld_lookup_symbol_versioned): Likewise. Add missing chunk Conflicts: trunk/ChangeLog.csl
2010-07-22Add missing pid initialisationMark Hatle
2009-04-23 Maciej W. Rozycki <macro@codesourcery.com> Issue #5165 * src/execle_open.c (execve_open): Add missing pid initialisation.
2010-07-22Merge to r174 -- cleanupMark Hatle
2010-06-15 Mark Hatle <mark.hatle@windriver.com> * Merge to upstream r174 * src/arch-mips.c, src/conflict.c, src/cxx.c, src/main.c, src/verify.c: fix items missed in the merge * Resync dso-readonly.c from dso.c
2010-07-22Merge branch 'prelink_r174' into cross_prelinkMark Hatle
Conflicts: trunk/doc/prelink.8 trunk/src/Makefile.am trunk/src/arch-arm.c trunk/src/arch-mips.c trunk/src/arch-sparc64.c trunk/src/conflict.c trunk/src/cxx.c trunk/src/prelink.h trunk/src/space.c trunk/testsuite/cxx1.sh trunk/testsuite/shuffle2.c
2010-07-22Fix MSB shift in prelink adjusting debug infocross_prelink_20061201Joseph S dot Myers
This patch fixes an incorrect shift by 58 instead of 56 when computing the most significant byte when prelink adjusts debug info. Please commit if OK. This problem manifests itself as test failures for SPARC64 but not other platforms I've tested, probably because the mmap_base setting for that platform has a nonzero MSB and most others don't. 2009-08-06 Joseph Myers <joseph@codesourcery.com> * src/dwarf2.c (dwarf2_write_le64, dwarf2_write_be64): Shift by 56 not 58 for MSB.
2010-07-22fsync files before closingMark Hatle
2009-03-19 Joseph Myers <joseph@codesourcery.com> Issue #4626 * src/cache.c, src/dso-readonly.c, src/dso.c, src/execstack.c, src/gather.c, src/layout.c, src/mapfile.c, src/verify.c: fsync file descriptors before closing them. Mark Hatle <mark.hatle@windriver.com> * src/dso-readonly.c: sync with changes above
2010-07-22Fix arm TLS_TPOFF32 handlingMark Hatle
2008-09-23 Joseph Myers <joseph@codesourcery.com> * src/arch-arm.c (arm_prelink_conflict_rela): Correct R_ARM_TLS_TPOFF32 handling. Conflicts: trunk/ChangeLog.csl
2010-07-22Add sparc64 fixesMark Hatle
2008-09-18 Joseph Myers <joseph@codesourcery.com> * src/ld-libs.c (reloc_type_class, determine_tlsoffsets): Handle SPARC. * src/arch-sparc64.c (sparc64_prelink_rela, sparc64_prelink_conflict_rela, sparc64_undo_prelink_rela, sparc64_reloc_class): Handle TLS relocations. (PL_ARCH(sparc64)): Update mmap_base and mmap_end for TASK_UNMAPPED_BASE change to 0xfffff80100000000.
2010-07-22SPARC64 prelink TLS and current kernels supportJoseph S dot Myers
This patch adds TLS support to SPARC64 prelink - largely cut-and-pasted from the 32-bit SPARC support - and updates it to work with kernels postdating the patch 8bcd17411643beb9a601e032d0cf1016909a81d3 "[SPARC64]: Do not allow mapping pages within 4GB of 64-bit VA hole." (March 2006), which changed TASK_UNMAPPED_BASE causing anything prelinked at the old address to segfault on startup. Please commit if OK. 2008-09-29 Joseph Myers <joseph@codesourcery.com> * src/arch-sparc64.c (sparc64_prelink_rela, sparc64_prelink_conflict_rela, sparc64_undo_prelink_rela, sparc64_reloc_class): Handle TLS relocations. (PL_ARCH): Update mmap_base and mmap_end for TASK_UNMAPPED_BASE change to 0xfffff80100000000.
2010-07-22Add MIPS64 prelinking and other associated itemsMark Hatle
2008-10-02 Maciej W. Rozycki <macro@codesourcery.com> * src/arch-mips.c (mips_prelink_reloc): Do not complain about TLS_DTPMOD32 or TLS_DTPMOD64 relocations found in executables. 2008-09-03 Maciej W. Rozycki <macro@codesourcery.com> * src/prelink.h (Elf64_Byte): New definition. (R_MIPS_TLS_DTPMOD64): New macro. (R_MIPS_TLS_DTPREL64): Likewise. (R_MIPS_TLS_TPREL64): Likewise. (RSS_UNDEF): Likewise. (PL_ARCH): Use plarch_##F as the name of the struct in all variants. * src/reloc-info.c: New file. * src/reloc-info.h: Likewise. * src/arch-mips.c (mips_buf_read_addr): New function. (mips_buf_write_addr): Likewise. (mips_arch_adjust): Replace calls to buf_read_une32() and buf_write_ne32() with ones to mips_buf_read_addr() and mips_buf_write_addr() respectively. (mips_read_addend): Rename to... (mips_read_32bit_addend): ... this. (mips_write_addend): Rename to... (mips_write_32bit_addend): ... this. (mips_read_64bit_addend): New function. (mips_write_64bit_addend): Likewise. (mips_adjust_reloc): Handle 64-bit REL relocations. Use reloc_r_sym() and reloc_r_type() in place of GELF_R_SYM() and GELF_R_TYPE() respectively. (mips_prelink_64bit_reloc): New function. (mips_prelink_reloc): Handle 64-bit REL and GLOB_DAT relocations. Handle TLS_DTPMOD64, TLS_DTPREL64 and TLS_TPREL64 relocations. Use reloc_r_sym() and reloc_r_type(). (mips_prelink_rel): Handle 64-bit REL relocations. Use reloc_r_sym(), reloc_r_type() and reloc_r_info_ext() (replacing GELF_R_INFO()). (mips_prelink_conflict_reloc): Handle 64-bit REL relocations. Handle TLS_DTPMOD64, TLS_DTPREL64 and TLS_TPREL64 relocations. Use reloc_r_sym(), reloc_r_type() and reloc_r_info_ext(). (mips_arch_prelink_conflict): Use mips_buf_read_addr(). Use reloc_r_info_ext(). (mips_apply_conflict_rela): Handle 64-bit REL relocations. Use reloc_r_type(). Use mips_buf_read_addr() and mips_buf_write_addr(). (mips_apply_reloc): Handle 64-bit REL relocations. Use reloc_r_sym() and reloc_r_type(). (mips_rel_to_rela): Handle 64-bit REL relocations. Handle TLS_DTPMOD64, TLS_DTPREL64 and TLS_TPREL64 relocations. Use reloc_r_sym() and reloc_r_type(). (mips_rela_to_rel): Handle 64-bit REL and GLOB_DAT relocations. Handle TLS_DTPMOD64, TLS_DTPREL64 and TLS_TPREL64 relocations. Use reloc_r_sym() and reloc_r_type(). (mips_need_rel_to_rela): Use data obtained with gelfx_getshdr() to determine the size of a relocation entry. Use gelfx_getrel() to retrieve them. Handle 64-bit REL relocations. Handle TLS_DTPMOD64, TLS_DTPREL64 and TLS_TPREL64 relocations. Use reloc_r_sym() and reloc_r_type() instead of ELF32_R_SYM() and ELF32_R_TYPE() respectively. (mips_reloc_class): Handle TLS_DTPMOD64, TLS_DTPREL64 and TLS_TPREL64 relocations. (mips_arch_prelink): Use mips_buf_read_addr() and mips_buf_write_addr(). (mips_arch_undo_prelink): Likewise. (mips_undo_prelink_rel): Handle 64-bit GLOB_DAT relocations. Use reloc_r_sym(), reloc_r_type() and reloc_r_info_ext(). (mips64): New PL_ARCH. * src/prelink.c (prelink_prepare): Handle SHT_MIPS_OPTIONS. * src/conflict.c (conflict_rela_cmp_dso): New variable. (conflict_rela_cmp): Use conflict_rela_cmp_dso and reloc_r_sym(). (get_relocated_mem): Use reloc_r_type(). (prelink_add_copy_rel): Use reloc_r_sym() and reloc_r_type(). (prelink_build_conflicts): Use reloc_r_sym(), reloc_r_type() and reloc_r_info(). Pass dso to conflict_rela_cmp() through conflict_rela_cmp_dso. (prelink_find_copy_rela): Use reloc_r_type(). * src/cxx.c (remove_redundant_cxx_conflicts): Use reloc_r_sym(), reloc_r_type() and reloc_r_info(). * src/ld-libs.c (do_rel_section): Use reloc_r_sym() and reloc_r_type(). * src/Makefile.am (common_SOURCES): Add reloc-info.c and reloc-info.h. (prelink_rtld_SOURCES): Likewise. * src/Makefile.in: Regenerate. * configure.in: Check for the Elf64_Byte type. Require autoconf 2.50. * configure: Regenerate. 2008-09-03 Maciej W. Rozycki <macro@codesourcery.com> * src/arch-mips.c (mips_undo_prelink_rel): Fix formatting. 2008-09-03 Maciej W. Rozycki <macro@codesourcery.com> * src/arch-mips.c (mips_init_local_got_iterator): Use ELF_T_ADDR to determine the width of GOT entries. (mips_init_global_got_iterator): Likewise. 200?-??-?? CodeSourcery, LLC. * src/prelink.h: define PL_ARCH(arch) macro * update each arch-<arch>.c file to use the new macro Add attribution
2010-07-22Fix the width of the data transferMark Hatle
2008-09-03 Maciej W. Rozycki <macro@codesourcery.com> * src/data.c (buf_read_une##nn): Fix the width of the data transfer used.
2010-07-22Additional MIPS prelinker supportMark Hatle
2008-03-06 Daniel Jacobowitz <dan@codesourcery.com> * src/ld-do-lookup.h: Check for STO_MIPS_PLT on MIPS. * src/ld-libs.c (reloc_type_class): Handle copy and PLT relocs. * src/prelink.h (R_MIPS_TLS_DTPMOD32, R_MIPS_TLS_DTPREL32) (R_MIPS_TLS_TPREL32, R_MIPS_GLOB_DAT): Remove duplicate definitions. (R_MIPS_COPY, R_MIPS_JUMP_SLOT, STO_MIPS_PLT, DT_MIPS_PLTGOT) (DT_MIPS_PLTNO, DT_MIPS_RWPLT): Define. (DSO): Add info_DT_MIPS_PLTGOT. * src/arch-mips.c (mips_prelink_reloc): Handle R_MIPS_JUMP_SLOT and R_MIPS_COPY. (mips_prelink_conflict_reloc): Handle R_MIPS_COPY. (mips_apply_conflict_rela): Handle R_MIPS_JUMP_SLOT. (mips_apply_reloc): Handle R_MIPS_JUMP_SLOT and R_MIPS_COPY. (mips_rel_to_rela, mips_rela_to_rel): Handle R_MIPS_COPY. (mips_need_rel_to_rela): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. Correct error message. (mips_reloc_class): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. Use RTYPE_CLASS_VALID by default. (mips_arch_prelink): Save .plt in gotplt[1]. (mips_arch_undo_prelink): Clear gotplt[1]. (mips_undo_prelink_rel): Undo R_MIPS_JUMP_SLOT relocations. (PL_ARCH): Set R_COPY and R_JMP_SLOT. * src/dso.c (read_dynamic): Save DT_MIPS_PLTGOT. Conflicts: trunk/ChangeLog.csl
2010-07-22Correct chroot/sysroot file canonicalizingMark Hatle
2007-07-09 Daniel Jacobowitz <dan@codesourcery.com> Issue #1816 * src/wrap-file.c (chroot_canon): Delete. (sysroot_file_name): Use canon_filename. (unsysroot_file_name): Make global. (wrap_canonicalize_file_name): Delete. * src/ld-libs.c (load_dsos): Use prelink_canonicalize. * src/canonicalize.c (canon_filename): Make global. Add chroot, allow_last_link, allow_missing arguments. Handle links inside a chroot. Handle canonicalizing the current directory. Remove debugging output. (prelink_canonicalize): Update. Use unsysroot_file_name. * src/prelink.h (wrap_canonicalize_file_name): Delete prototype.
2010-07-22Update load_dsos to avoid canonicalizing host filenames within the sysrootMark Hatle
2007-02-16 Daniel Jacobowitz <dan@codesourcery.com> * src/prelink.h (sysroot_file_name): Declare. * src/wrap-file.c (sysroot_file_name): match declaration * src/ld-libs.c (load_dsos): Take host_paths argument. Do not attempt to canonicalize host filenames within the sysroot. Always set canon_filename. (process_one_dso): Update call to load_dsos. Do not redo call to wrap_canonicalize_file_name.
2010-07-22Add configurable version and bug urlMark Hatle
2006-11-30 Mark Shinwell <shinwell@codesourcery.com> * configure.in: Recognize --with-pkgversion and ---with-bugurl. * src/Makefile.am: Pass package version and bug URL through AM_CFLAGS, together with the new EXECSTACK_PROG. * src/main.c: Use PKGVERSION and REPORT_BUGS_TO. * src/execstack.c: Likewise. Also use EXECSTACK_PROG. Mark Hatle <mark.hatle@windriver.com> * src/ld-libs.c: Use PRELINK_RTLD_PROG, PKGVERSION and REPORT_BUGS_TO * src/execstack.c: Use EXECSTACK_PROG in (argp_doc)
2010-07-22Cleanup wrap_statMark Hatle
2006-11-30 Mark Shinwell <shinwell@codesourcery.com> * wrap-file.c (wrap_stat_body): New. (wrap_lstat64, wrap_stat64): Use wrap_stat_body. * gather.c (add_to_blacklist): Add missing wrap_stat64
2010-07-22Determine machine type and add assert on buffer overflowMark Hatle
2006-11-28 Mark Shinwell <shinwell@codesourcery.com> * src/layout.c (layout_libs): Add assertion to check for buffer overflow. * src/ld-libs.c (find_lib_in_path): Add "machine" argument. Skip libraries whose ELF machine type field does not match that argument. (find_lib_by_soname): Add "machine" argument. Pass it to find_lib_in_path. (load_dsos): Determine machine type of input DSO. Pass it to find_lib_by_soname. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Conflicts: trunk/ChangeLog.csl
2010-07-22Add function to determine if it's PIEMark Hatle
2006-11-28 Mark Shinwell <shinwell@codesourcery.com> * src/gather.c (maybe_pie): New. (gather_func): Use it.
2010-07-22Merge to r150Mark Hatle
2006-11-28 Mark Shinwell <shinwell@codesourcery.com> * src/canonicalize.c: Add prelink.h include directive. Use wrap_readlink and wrap_lstat64. * src/prelink.h: Declare wrap_readlink. * src/wrap-file.c (wrap_readlink): New.
2010-07-22Add an error message if execve failsMark Hatle
2006-10-13 Daniel Jacobowitz <dan@codesourcery.com> * src/execle_open.c (execve_open): Add an error message if execve fails. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-07-22Add PRELINK_PROG and PRELINK_RTLD_PROGMark Hatle
2006-10-03 Richard Sandiford <richard@codesourcery.com> * configure.in (AC_CANONICAL_HOST): Remove in favour of... (AC_CANONICAL_SYSTEM): ...this new directive. (AC_ARG_PROGRAM): New directive. * src/Makefile.am (AM_CFLAGS): Define PRELINK_PROG, PRELINK_RTLD_PROG and EXEEXT. (execstack_LDADD): Add -liberty. * src/execstack.c (program_path, prelink_path): New variables. (execstack_make_rdwr): Initialize prelink_path if it has not been set yet. Use make_relative_prefix, PRELINK_PROG and EXEEXT to get the full pathname of the prelink executable. Pass this path to execl() as the name of executable file. (main): Initialize program_path. * src/main.c (argp_program_version, argp_doc): Use PRELINK_PROG as the program name. (main): Handle empty --rtld= arguments first. Always use make_relative_prefix to work out the path of the defalt rtld executable. Also use PRELINK_RTLD and EXEEXT for this purpose. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-07-22Add switch to disable selinux when linkingMark Hatle
Add --disable-selinux. Also remove static linking as many modern components do not support static linking.
2010-07-22Import from: prelink-mips-n32.patchMark Hatle
* src/arch-mips.c: add /lib32/ld.so.1 as an alternative 32-bit linker * src/ld-libs.c: add a check for MIPS n32, and adjust ld_dirs as necessary
2010-07-22Reuse PT_NULL program headersRichard Sandiford
My original binutils patches for MIPS prelink support were against 2.17, and reserved room for a program header without actually creating one. The mainline (now 2.18) binutils patches ended up adding a PT_NULL header instead. This was needed because of mainline's SIZEOF_HEADER relaxation and was probably a better idea anyway. The patch below therefore teaches the prelinker to remove a PT_NULL header if it needs to find room for a PT_LOAD header. Tested on the MIPS port, where it allows a sysroot built with the mainline binutils to be fully prelinked. Also tested on x86. The patch involves a lot of reidentation, so for reference, I've attached two versions: first the real patch, then the -b form. Richard 200x-xx-xx Richard Sandiford <richard@codesourcery.com> * src/space.c (find_readonly_space): If a new PT_LOAD header is needed, first try removing a PT_NULL header.
2010-07-22Update ld-libs.c for the newer version of prelinkMark Hatle
2006-09-27 Richard Sandiford <richard@codesourcery.com> * src/ld-libs.c (reloc_type_class): Handle EM_MIPS. (do_mips_global_relocs): New function. (handle_relocs_in_entry): Call it. (determine_tlsoffsets): Handle EM_MIPS. 2006-09-27 Richard Sandiford <richard@codesourcery.com> * src/ld-libs.c (do_reloc): New function, split out from do_rel_section. Take the symbol and relocation type as arguments. (do_rel_section): Call it. (handle_relocs_in_entry): New function. (handle_relocs): Call it.
2010-07-22Update elf.h to latest versionMark Hatle
Update to the latest version of elf.h that includes MIPS prelink.
2010-07-22Merge branch 'prelink_20061201' into cross_prelinkMark Hatle
Conflicts: src/data.c trunk/src/dso.c trunk/src/prelink.h trunk/testsuite/reloc5.c trunk/testsuite/shuffle2.c Updated versioning in: trunk/src/execstack.c trunk/src/ld-libs.c trunk/src/main.c * src/arch-arm.c: remove read_une32, write_ne32, buf_write_ne32, buf_read_une32 * src/dso-readonly.c: sync to changes in src/dso.c
2009-08-07 * src/dwarf2.c (dwarf2_write_le64, dwarf2_write_be64): Shift by 56prelink_r174jakub
not 58 for MSB. git-svn-id: http://sourceware.org/svn/prelink@174 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-07-09 * src/conflict.c (prelink_build_conflicts): Don't calljakub
prelink_conflict_rel{,a} on .gnu.conflict section in executables. git-svn-id: http://sourceware.org/svn/prelink@173 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-06-15 * src/prelink.h (R_386_IRELATIVE, R_X86_64_IRELATIVE): Definejakub
if not defined. (struct PLArch): Add dest_addr argument to apply_conflict_rela hook. (struct prelink_conflict): Change used type from int to unsigned char, add ifunc field. (get_relocated_mem): Add dest_addr argument. * src/get.c (prelink_record_relocations): Handle lookups resolving to STT_GNU_IFUNC symbols. * src/conflict.c (get_relocated_mem): Add dest_addr argument, pass it through to the apply_conflict_rela hook. Fail if apply_conflict_rela hook failed. (prelink_build_conflicts): Build conflicts even in the executable, and for libraries even if no conflicts were reported by the dynamic linker. In the executable ignore any unused conflicts except for ifunc conflicts. Adjust get_relocated_mem callers. * src/cxx.c (remove_redundant_cxx_conflicts): Adjust get_relocated_mem callers. * arch-alpha.c (alpha_apply_conflict_rela): Add dest_addr argument. (alpha_prelink_conflict_rela): Return early if info->dso == dso. * arch-arm.c (arm_apply_conflict_rela): Add dest_addr argument. (arm_prelink_conflict_rel, arm_prelink_conflict_rela): Return early if info->dso == dso. * arch-cris.c (cris_apply_conflict_rela): Add dest_addr argument. (cris_prelink_conflict_rela): Return early if info->dso == dso. * arch-ia64.c (ia64_apply_conflict_rela): Add dest_addr argument. (ia64_prelink_conflict_rela): Return early if info->dso == dso. * arch-ppc.c (ppc_apply_conflict_rela): Add dest_addr argument. (ppc_prelink_conflict_rela): Return early if info->dso == dso. * arch-ppc64.c (ppc64_apply_conflict_rela): Add dest_addr argument. (ppc64_prelink_conflict_rela): Return early if info->dso == dso. * arch-s390.c (s390_apply_conflict_rela): Add dest_addr argument. (s390_prelink_conflict_rela): Return early if info->dso == dso. * arch-s390x.c (s390x_apply_conflict_rela): Add dest_addr argument. (s390x_prelink_conflict_rela): Return early if info->dso == dso. * arch-sh.c (sh_apply_conflict_rela): Add dest_addr argument. (sh_prelink_conflict_rela): Return early if info->dso == dso. * arch-sparc.c (sparc_apply_conflict_rela): Add dest_addr argument. (sparc_prelink_conflict_rela): Return early if info->dso == dso. * arch-sparc64.c (sparc64_apply_conflict_rela): Add dest_addr argument. (sparc64_prelink_conflict_rela): Return early if info->dso == dso. * arch-mips.c (mipz_apply_conflict_rela): Add dest_addr argument. (mips_prelink_conflict_reloc, mips_arch_prelink_conflict): Return early if info->dso == dso. * arch-i386.c (i386_adjust_rel, i386_adjust_rela, i386_prelink_rel, i386_prelink_rela, i386_rel_to_rela, i386_undo_prelink_rel, i386_rela_to_rel): Handle R_386_IRELATIVE. (i386_apply_conflict_rela): Add dest_addr argument, handle R_386_IRELATIVE. (i386_prelink_conflict_rel, i386_prelink_conflict_rela): Handle R_386_IRELATIVE and conflict->ifunc conflicts. * arch-x86_64.c (x86_64_adjust_rela, x86_64_prelink_rela, x86_64_undo_prelink_rela): Handle R_X86_64_IRELATIVE. (x86_64_apply_conflict_rela): Handle R_X86_64_IRELATIVE and conflict->ifunc conflicts. * testsuite/Makefile.am (TESTS): Add ifunc1.sh, ifunc2.sh and ifunc3.sh. * testsuite/Makefile.in: Regenerated. * testsuite/ifunc1.sh: New test. * testsuite/ifunc2.sh: New test. * testsuite/ifunc3.sh: New test. * testsuite/ifunc1.c: New file. * testsuite/ifunc1lib1.c: New file. * testsuite/ifunc1lib2.c: New file. * testsuite/ifunc3.c: New file. * testsuite/ifunc3lib1.c: New file. * testsuite/ifunc.h: New file. * testsuite/ifunctest.c: New file. git-svn-id: http://sourceware.org/svn/prelink@172 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-06-15 * src/Makefile.am (DEFS, AM_CFLAGS): Add -Wno-pointer-sign.jakub
* src/Makefile.in: Regenerated. * src/data.c (reopen_dso): Initialize data variable to avoid warnings. git-svn-id: http://sourceware.org/svn/prelink@171 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-06-15 * dwarf2.h (DW_TAG_condition, DW_TAG_shared_type): Define.jakub
(DW_OP_form_tls_address, DW_OP_call_frame_cfa, DW_OP_bit_piece, DW_OP_implicit_value, DW_OP_stack_value, DW_OP_GNU_uninit, DW_OP_GNU_encoded_addr): Define. (DW_ATE_packed_decimal, DW_ATE_numeric_string, DW_ATE_edited, DW_ATE_signed_fixed, DW_ATE_unsigned_fixed, DW_ATE_decimal_float): Define. (DW_CFA_val_offset, DW_CFA_val_offset_sf, DW_CFA_val_expression): Define. (DW_LANG_PLI, DW_LANG_ObjC, DW_LANG_ObjC_plus_plus, DW_LANG_UPC, DW_LANG_D): Define. * dwarf2.c (debug_sections): Add .debug_pubtypes. (DEBUG_PUBTYPES): Define. (DEBUG_MACINFO, DEBUG_LOC, DEBUG_STR, DEBUG_FRAME, DEBUG_RANGES): Adjust. (struct cu_data): Add cu_version field. (read_abbrev): Adjust error messages not to be DWARF-2 specific. (adjust_location_list): Likewise. Fix up DW_OP_call_ref handling, handle DW_OP_form_tls_address, DW_OP_call_frame_cfa, DW_OP_GNU_uninit, DW_OP_bit_piece, DW_OP_stack_value and DW_OP_implicit_value. (adjust_attributes): For cu->cu_version == 2 skip ptr_size bytes instead of just 4. Adjust error messages not to be DWARF-2 specific. (adjust_dwarf2_line): Handle version 3 of .debug_line. (adjust_dwarf2_frame): Just that CIE version is 1 or 3, for version 1 skip just one byte instead of uleb128 for return address column. Handle DW_CFA_val_offset, DW_CFA_val_offset_sf and DW_CFA_val_expression. (adjust_dwarf2): Handle version 3 of .debug_info, initialize cu.cu_version. Adjust error messages not to be DWARF-2 specific. Note that .debug_pubtypes doesn't need adjustments. git-svn-id: http://sourceware.org/svn/prelink@169 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-03-11 * src/prelink.h (PLArch): Add rtype_class_valid field.jakub
* src/get.c (prelink_record_relocations): If not /4, or dso->arch->rtype_class_valid instead of RTYPE_CLASS_VALID into reloc_class. * src/cxx.c (remove_redundant_cxx_conflicts): Use info->dso->arch->rtype_class_valid instead of RTYPE_CLASS_VALID. * src/arch-ppc64.c (ppc64_reloc_class): For R_PPC64_COPY return RTYPE_CLASS_COPY | RTYPE_CLASS_PLT, for non-TLS relocs return RTYPE_CLASS_PLT. (PL_ARCH): Set rtype_class_valid to RTYPE_CLASS_PLT. * src/arch-alpha.c (PL_ARCH): Set rtype_class_valid to RTYPE_CLASS_VALID. * src/arch-arm.c (PL_ARCH): Likewise. * src/arch-cris.c (PL_ARCH): Likewise. * src/arch-i386.c (PL_ARCH): Likewise. * src/arch-ia64.c (PL_ARCH): Likewise. * src/arch-mips.c (PL_ARCH): Likewise. * src/arch-ppc.c (PL_ARCH): Likewise. * src/arch-s390.c (PL_ARCH): Likewise. * src/arch-s390x.c (PL_ARCH): Likewise. * src/arch-sh.c (PL_ARCH): Likewise. * src/arch-sparc.c (PL_ARCH): Likewise. * src/arch-sparc64.c (PL_ARCH): Likewise. * src/arch-x86_64.c (PL_ARCH): Likewise. git-svn-id: http://sourceware.org/svn/prelink@168 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-03-10 * src/arch-arm.c (arm_prelink_rel, arm_prelink_rela,jakub
arm_prelink_conflict_rel, arm_prelink_conflict_rela, arm_rel_to_rela, arm_rela_to_rel, arm_need_rel_to_rela, arm_undo_prelink_rel, arm_reloc_class): Handle TLS relocations. * src/prelink.h (R_ARM_TLS_DTPMOD32, R_ARM_TLS_DTPOFF32, R_ARM_TLS_TPOFF32): Define if R_ARM_TLS_DTPMOD32 not already defined. git-svn-id: http://sourceware.org/svn/prelink@166 94c539fb-cf18-0410-b60f-edeeb537fa16
2009-03-10 * src/arch-arm.c (arm_adjust_dyn, arm_adjust_rel, arm_adjust_rela,jakub
arm_prelink_rel, arm_prelink_rela, arm_apply_conflict_rela, arm_apply_rel, arm_apply_rela, arm_prelink_conflict_rela, arm_rel_to_rela, arm_rela_to_rel, arm_need_rel_to_rela, arm_arch_prelink, arm_arch_undo_prelink, arm_undo_prelink_rel): Use endian-neutral functions. git-svn-id: http://sourceware.org/svn/prelink@165 94c539fb-cf18-0410-b60f-edeeb537fa16
2008-10-09 * src/arch-sparc64.c (sparc64_prelink_rela,jakub
sparc64_prelink_conflict_rela, sparc64_undo_prelink_rela, sparc64_reloc_class): Handle TLS relocations. (PL_ARCH): Update mmap_base and mmap_end for TASK_UNMAPPED_BASE change to 0xfffff80100000000. git-svn-id: http://sourceware.org/svn/prelink@164 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-12-04 * gather.c (gather_object): Print an error if nftw64 fails.drow
git-svn-id: http://sourceware.org/svn/prelink@162 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-09 * src/cxx.c (remove_redundant_cxx_conflicts): Allow .sdatajakub
section as well. git-svn-id: http://sourceware.org/svn/prelink@161 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-09 * src/prelink.h (struct prelink_conflict): Add next2 field.jakub
(struct prelink_conflicts): Add hash2 field. * src/get.c (prelink_record_relocations): Clear next2 fields. * src/prelink.c (free_info): Also free hash2 table. * src/cxx.c (remove_redundant_cxx_conflicts): Populate hash2 if not populated yet, use it to speed up pltref checking. git-svn-id: http://sourceware.org/svn/prelink@160 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-09 * src/prelink.h (struct prelink_conflicts): New type.jakub
(struct prelink_info): Change type of conflicts and curconflicts fields to struct prelink_conflicts *. * src/get.c (conflict_hash_init): New function. (prelink_record_relocations): Adjust initialization of conflicts array. If conflict linked lists has more than 15 entries, use hash table with chains. * src/prelink.c (free_info): Handle freeing conflict list using a hash table. * src/fptr.c (opd_init): Only walk corresponding hash chain if conflict list is using a hash table. * src/conflict.c (prelink_conflict): Likewise. (prelink_build_conflicts): Handle conflict list using a hash table. * src/cxx.c (remove_redundant_cxx_conflicts): Likewise. Only walk corresponding hash chain if conflict list is using a hash table. git-svn-id: http://sourceware.org/svn/prelink@159 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-09 * src/doit.c (find_ents): Clear e->u.tmp.jakub
(clear_ent_marks, find_unlisted_dependency): Remove. (prelink_ent): More efficient non-recursive check for unlisted dependencies. git-svn-id: http://sourceware.org/svn/prelink@158 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-09 * src/cxx.c (find_cxx_sym): If fcs->lastndx != -1, search firstjakub
among symbols around it. git-svn-id: http://sourceware.org/svn/prelink@157 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-08 * src/space.c (find_readonly_space): Disallow section insertion injakub
between adjacent SHT_NOTE sections. When creating new PT_LOAD, handle multiple consecutive SHT_NOTE sections with just one PT_NOTE segment for them. * testsuite/Makefile.am (TESTS): Add shuffle9.sh. * testsuite/Makefile.in: Regenerated. * testsuite/shuffle9.sh: New test. * testsuite/shuffle9.c: New. * testsuite/shuffle2.c: Add .previous at the end of __asm. * testsuite/reloc5.c (main): Likewise. * testsuite/tls3.sh: If libs aren't built with -fpic, disable the test under SELinux in enforcing mode. git-svn-id: http://sourceware.org/svn/prelink@156 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-08 * src/cxx.c: Include alloca.h.jakub
(specials): Moved out of remove_redundant_cxx_conflicts to toplevel. Remove section fields. (find_cxx_sym_valsize, find_cxx_sym_cache): New structs. (struct find_cxx_sym): Add cache and lastndx fields. (cachecmp, create_cache): New functions. (find_cxx_sym): Add cache argument. If cache[n] is NULL, call create_cache. Do a binary search in cache[n]->vals array instead of always reading the whole symbol table. (remove_redundant_cxx_conflicts): Adjust find_cxx_sym caller. Check if secname is ".data" or ".data.rel.ro" instead of comparing it against specials[k].secname. Use binary search in binsymcache when doing check_pltref checks. * testsuite/Makefile.am (TESTS): Add cxx2.sh. * testsuite/Makefile.in: Regenerated. * testsuite/cxx1.sh: Check that some conflicts are optimized out by C++ optimizations. * testsuite/cxx2.sh: New test. * testsuite/cxx2.C: New. git-svn-id: http://sourceware.org/svn/prelink@155 94c539fb-cf18-0410-b60f-edeeb537fa16
2007-10-04 * src/prelink.h (read_config): New prototype.jakub
(gather_config, blacklist_from_config): Remove argument. * src/gather.c (struct config_line): New type. (config_lines, config_end): New variables. (read_config): New function. (gather_config, blacklist_from_config): Walk config_lines chain instead of reading the config file. * src/verify.c (prelink_verify): Call read_config. Don't pass any argument to gather_config. * src/main.c (main): Likewise. Also for blacklist_from_config. * testsuite/quick2.sh: Use new -c etc/prelink.conf.d/*.conf feature in prelink.conf and multiple config snippets. git-svn-id: http://sourceware.org/svn/prelink@154 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-12-01 * src/verify.c (prelink_verify): Unlink ent->filename in case ofprelink_20061201jakub
failures between closing the unprelinked dso and unlinking ent->filename. git-svn-id: http://sourceware.org/svn/prelink@151 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-10-27 * src/prelink.h (READWRITEPROTOSIZE): Undef after use.jakub
git-svn-id: http://sourceware.org/svn/prelink@150 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-10-27 * src/Makefile.am (arch_SOURCES): Add arch-mips.cjakub
* src/Makefile.in: Regenerate. * src/arch-mips.c: New file. git-svn-id: http://sourceware.org/svn/prelink@146 94c539fb-cf18-0410-b60f-edeeb537fa16