aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-08-18src/arch-aarch64.c:testsuite failure fixes in aarch64cross_prelink_aarch64Maninder Singh
This patch fixes testsuite failure in aarch64 prelink undo section. 2016-03-10 Vaneet Narang <v.narang@samsung.com> Maninder Singh <maninder1.s@samsung.com> * src/arch-aarch64.c: Fix prelink undo error Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-08-18testsuite: fixes in testsuite according to aarch64Maninder Singh
This Patch fixes testsuite by adding support of aarch64 2016-03-10 Vaneet Narang <v.narang@samsung.com> Maninder Singh <maninder1.s@samsung.com> * testuite/reloc2.sh, testsuite/reloc8.sh, testsuite/reloc9.sh, testsuite/tls3.sh: Fix test suite errors Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-08-18arch-aarch64.c: Fix AARCH64_TLSDESC relocation conflictManjeet Pawar
This patch needs to be applied to 'cross_prelink_aarch64' branch. It fixes tls1, tls2, tls4, tls5, tls6 test cases of prelink testsuite. tls3 gets failed but this test case fails without prelink as well on AARCH64 2016-03-10 Vaneet Narang <v.narang@samsung.com> Manjeet Pawar <manjeet.p@samsung.com> * arch-aarch64.c: (aarch64_prelink_conflict_rela) fix TLSDESC Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-08-18prelink: AARCH64 support addedManinder Singh
This patch adds support for prelinking in AARCH64. To run prelink on successfully on target following changes are done 1. aarch64/dl-machine.h: Fix load-address for prelink support https://sourceware.org/ml/libc-alpha/2015-10/msg00575.html 2. To handle relocation R_AARCH64_TLSDESC, Conflicts are raised for R_AARCH64_TLSDESC. Conflicts of relocation type R_AARCH64_TLSDESC is handled by _dl_tlsdesc_undefweak which return the addend minus the thread pointer. Hacked _dl_tlsdesc_undefweak to return addend only. Need to Fix this hack. 2016-03-10 Vaneet Narang <v.narang@samsung.com> Maninder Singh <maninder1.s@samsung.com> * Makefile.am: add arch-aarch64.c * arch-aarch64.c: New file * dso.c: (dso_has_bad_textrel) add aarch64 Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-08-18README: Add known issues to the READMEMark Hatle
2016-08-17 Mark Hatle <mark.hatle@windriver.com> * README: Update to include a few known issues Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-08-17src/rtld/dl-open.c: Change to work with older compilersMark Hatle
2016-08-17 Mark Hatle <mark.hatle@windriver.com> * src/rtld/dl-open.c: Change to work with older compilers Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-06-03Fix prelink section ordering on subsequent prelinkDave Lerner
Some linkers create a binary which has a section header table that is not in section header offset order. However, as noted in check_dso(), several routines in prelink and in libelf-0.7.0 too rely on sh_offsets monotonically increasing, and if that fails then prelink quits. But the check is only on dso's, not binaries. For binaries, fdopen_dso() reorders the section headers to section header offset order prior to work on the section data, so that the new prelinked binary is written in section order. However, on subsequent prelinks of a prelinked binary, the prelink_exec() works on the undone section, not the fdopen_dso() reordered sections, and may construct a section header table with section orders different than the first prelink of the binary. The function below tests for that case and resets the section header order to the offset order by enforcing the binutils linker change: 'The net effect is .shstrab section is now placed after .symtab and .strtab sections'. See binutils-gdb.git commit 3e19fb8f990e4c. Signed-off-by: Dave Lerner <dave.lerner@windriver.com> 2016-06-03 Dave Lerner <dave.lerner@windriver.com> * src/exec.c: New check_reorder_needed, section_reorder_fix functions Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22Fix LD_PRELOAD w/o rtld caseMark Hatle
2016-03-22 Mark Hatle <mark.hatle@windriver.com> * src/gather.c, src/get.c: Fix LD_PRELOAD Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22Fix prelink-rtld depth-first search, should be breadth firstMark Hatle
2016-03-18 Donn Seeley <donn.seeley@windriver.com> * src/rtld/rtld.c: rewrite build_local_scope to ensure breadth-first processing * testsuite/order: Add test to verify prelink/prelink-rtld resolution order This problem was causing a conflict in the Yocto Project between 'fork' from libc and libpthread. See Yocto Project bug 9131. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22Fix compilation warningsMark Hatle
2016-03-18 Mark Hatle <mark.hatle@windriver.com> * src/rtld/rtld.h, src/dso.c: Fix compilation warning Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22src/rtld: Add ability to debug scopeMark Hatle
2016-03-18 Mark Hatle <mark.hatle@windriver.com> * dl-open.c, rtld.h, Makefile.am: Add _dl_show_scope function * rtld.c: Use _dl_show_scope if RTLD_DEBUG=scopes defined Generate a scope for the exectuable Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22rtld/dl-load.c: Fix segfault on uninitialized DSOMark Hatle
2016-03-10 Mark Hatle <mark.hatle@windriver.com> * dl-load.c: Fix segfault on empty dso entry Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22rtld: Resync to glibc-2.23Mark Hatle
2016-03-10 Mark Hatle <mark.hatle@windriver.com> * rtld/: Rsync to glibc-2.23 (no functional changes) Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22Update .gitignoreMark Hatle
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-03-22configure.ac/makefile.am: Update to newer autoconf/automake formatMark Hatle
Resolves an issue: configure.ac:8: warning: AM_INIT_AUTOMAKE: two- and three-arguments change based on a patch from Vaneet Narang <v.narang@samsung.com> and Maninder Singh <maninder1.s@samsung.com> Add AC_CONFIG_MACRO_DIR([m4]) to configure.ac to resolve warning. Quote AC_LIBELF_SXWORD in m4/libelf.m4 to resolve: warning: underquoted definition of AC_LIBELF_SXWORD in m4/libelf.m4 In Makefile.am files, replace INCLUDES w/ AM_CPPFLAGS as appropriate. Remove 'AUTOMAKE_OPTIONS = 1.4 gnu', no longer necessary. 2016-03-10 Mark Hatle <mark.hatle@windriver.com> * configure.ac, m4/libelf.m4, doc/Makefile.am, gelf/Makefile.am, gelfx/Makefile.am, gelfx32/Makefile.am, patches/Makefile.am, src/Makefile.am, src/rtld/Makefile.am, testsuite/Makefile.am: Update to avoid autoconf/automake warnings Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-29Fix ARM IFUNC support20151030_crossMark Hatle
In the original ARM IFUNC support, it appears a small chunk of code in the arm_prelink_conflict_rela function was missed. This commit adds the missing code from the original work. See: https://bugzilla.redhat.com/show_bug.cgi?id=1009601 2015-10-29 Mark Hatle <mark.hatle@windriver.com> Kyle McMartin <kmcmartin@redhat.com> Jakub Jelinek <jakub@redhat.com> Julian Brown <julian@codesourcery.com> * testsuite/ifunc.h: Fix missing # * src/arch-arm.c (arm_prelink_conflict_rela): Add missing hunk that implemented R_ARM_IRELATIVE, and ifunc conflicts. See: https://bugzilla.redhat.com/show_bug.cgi?id=1009601 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-29prelink: Fix MIPS section header checkMark Hatle
MIPS has added a new SHT_MIPS_ABIFLAGS section, which the prelinker did not know it could skip. Add this to the list of items to be OK to skip. 2015-10-29 Mark Hatle <mark.hatle@windriver.com> * prelink.h: Define SHT_MIPS_ABIFLAGS if not set * prelink.c: OK to skip SHT_MIPS_ABIFLAGS optimize the loop to stop on the first bad entry adjust the error to give us more info on the bad section Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28testsuite/.gitignore: Ignore all of the misc artifacts from the tests.Mark Hatle
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28src/get.c: Sync the rtld and prelinker to the same defineMark Hatle
No actual change in the defined value occurs, but the format on both sides of the interface (rtld and prelinker) are now using the same define. 2015-10-28 Mark Hatle <mark.hatle@windriver.com> * get.c: Sync rtld/prelink type_class values Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28rtld: Fix the prelink-rtld to use the same method as ld.soMark Hatle
2015-10-28 Mark Hatle <mark.hatle@windriver.com> * dl-lookupX.h: Sync with glibc fix for ld.so / prelink mismatch 2015-10-28 H.J. Lu <hongjiu.lu@intel.com> [BZ #19178] * elf/dl-lookup.c (RTYPE_CLASS_VALID): New. (RTYPE_CLASS_PLT): Likewise. (RTYPE_CLASS_COPY): Likewise. (RTYPE_CLASS_TLS): Likewise. (_dl_debug_bindings): Use RTYPE_CLASS_TLS and RTYPE_CLASS_VALID to set relocation type class for DL_DEBUG_PRELINK. Clear the ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA bit for DL_DEBUG_PRELINK. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28Upstream prelink project appears abandoned, take over the projectMark Hatle
The upstream project appears to be dead now. So switch to a more git friendly directory, no reason to maintain the SVN trunk any longer. 2015-10-22 Mark Hatle <mark.hatle@windriver.com> * Upstream project appears to have been abandoned * Update the project to remove the SVN like 'trunk' dir * Adjust the AUTHORS file * Move the README.cross to replace README and update it * Move the previous ChangeLog to ChangeLog.1 * Move the current ChangeLog.cross to ChangeLog Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28prelink: Add debugging to conflict resolution errorMark Hatle
2015-10-21 Mark Hatle <mark.hatle@windriver.com> * get.c, prelink.h: Add symname to conflict structure * conflict.c: Provide more debuggign on a conflict (symname) Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28rtld: Update debugging to be more glibc-2.22 likeMark Hatle
2015-10-21 Mark Hatle <mark.hatle@windriver.com> * rtld/rtld.c: Update debug msg Fix missing dso_list->map = NULL * rtld/dl-lookupX.h: update debug msgs * rtld/dl-load.c: (create_map_object_from_dso_ent) Add ld.so like debug When an executable sets a load address use it Update the load address calculation, prevents visual overlaps * rtld/dl-version.c: update debug msgs * rtld/rtld.h: define _dl_debug_printf to act like ld.so debug define RTLD_DEBUG_PID to set the debug prefix Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-10-28rtld: Start sync to glibc 2.22Mark Hatle
2015-10-21 Mark Hatle <mark.hatle@windriver.com> * Resync src/rtld to glibc-2.22 * src/elf.h, src/rtld/*: Update elf.h to glibc 2.22 version 2015-10-21 Mark Hatle <mark.hatle@windriver.com> * rtld/: Resync to glibc-2.22 * rtld/*: Update copyright dates to match glibc-2.22 * rtld/rtld.c: Update the elf_machine_type class entries Add support for ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA via new extern_protected_data function. rename reloc_typeclass to elf_machine_type_class add machine_no_rela, machine_no_rel funcs * rtld/dl-tls.c: (rtld_determine_tlsoffsets) add NIOS2 definition * rtld/dl-lookup.c * rtld/dl-lookupX.h: Add EXTERN_PROTECTED_DATA support * glibc changes directly affecting the implementation: 2013-12-04 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> Alan Modra <amodra@gmail.com> * libc/sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_type_class): Use SHN_UNDEF PLT handling for ELFv2 ABI. 2015-01-18 Chung-Lin Tang <cltang@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> Andrew Jenner <andrew@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * sysdeps/nios2/dl-machine.h: New file. 2015-03-31 H.J. Lu <hongjiu.lu@intel.com> * elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which indicates it is called from do_lookup_x on relocation against protected data, skip the data definion in the executable from copy reloc. (_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA, instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol. * sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT. * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT. 2015-07-24 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/aarch64/dl-machine.h (elf_machine_type_class): Handle ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA. * sysdeps/arm/dl-machine.h (elf_machine_type_class): Handle ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-09-11prelink: --ld-preload= add man page entry and testsuiteMark Hatle
2015-09-11 Mark Hatle <mark.hatle@windriver.com> * doc/prelink.8: Add --ld-preload docs * testsuite/Maekfile.am, testsuite/preload1*: Add test Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-09-11src/main.c, rtld/rtld.c: Add --ld-preload optionManinder Singh
prelink fails if there are ld_preload libs present at target with below error. expect libsX.so.1, found /lib/libY.so in dependency order where libY.so.1 is ld_preload lib To use this feature : ./prelink --ld-preload=libpreload1.so:libpreload2.so:.... upto 20 libs Order of libraries to be preloaded is significant. Make sure sequence mentioned in prelink should be same as runtime sequence. 2015-09-11 Vaneet Narang <v.narang@samsung.com> * src/gather.c, src/get.c, src/main.c, src/prelink.h: Add ability to specify preloaded libraries that influence the prelinker. 2015-09-11 Vaneet Narang <v.narang@samsung.com> * rtld/rtld.c: Add ability to specify preloaded libraries Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Reviewed-by: Ajeet Yadav <ajeet.v@samsung.com> Reviewed-by: Geon-ho Kim <gh007.kim@samsung.com> Adjusted the --help in main.c and rtld/rtld.c slightly. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-09-09src/gather.c: cleanup codeManinder Singh
Remove dso NULL check because before calling this API already checking for dso NULL and also dso pointer is used before this check. 2015-09-09 Akhilesh Kumar <akhilesh.k@samsung.com> * src/gather.c: Remove unnecessary dso NULL check Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Reviewed-by: Ajeet Yadav <ajeet.y@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-09-09src/rtld/rtld.c: dso validation check fixManinder Singh
dso null pointer check is wrongly placed. 2015-09-09 Maninder Singh <maninder1.s@samsung.com> Mark Hatle <mark.hatle@windriver.com> * rtld/rtld.c: dso null pointer check fix Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Vaneet Narang <v.narang@samsung.com> Reviewed-by: Ajeet Yadav <ajeet.y@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-09-09src/*: realloc fix memory leakManinder Singh
Free previously allocated memory if realloc fails. 2015-09-09 Maninder Singh <maninder1.s@samsung.com> * src/doit.c, src/gather.c, src/undoall.c: Fix realloc memory leak Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Vaneet narang <v.narang@samsung.com> Reviewed-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-09-08src/arch-arm.c: set max_page_size to match new ARM BDF defaultAndrew Stubbs
The maximum page size setting for ARM32 has been changed: https://sourceware.org/ml/binutils/2014-06/msg00228.html The attached patch updates prelink to match. It ought to be harmless when the default page size is smaller. Andrew 2015-09-07 Andrew Stubbs <ams@codesourcery.com> * src/arch-arm.c (PL_ARCH(arm)): Set max_page_size to match the new BFD default. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-04-07src/gather.c: Add debug messages for dependencies when not foundManinder Singh
2015-04-06 Mark Hatle <mark.hatle@windriver.com> Maninder Singh <maninder1.s@samsung.com> * src/gather.c: Return rtld error messages on failure prelink gives below error message for failure dependency: ./prelink: /test_binary: Could not find one of the dependencies This provides name of dependent library which is missing like below: ./prelink: /test_binary: Could not find one of the dependencies: ./prelink-rtld: error while loading shared libraries: libB.so: cannot open shared object file: No such file or directory where libB.so is missing dependecy Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Vaneet Narang <v.narang@samsung.com> Reviewed-by: Ajeet Yadav <ajeet.y@samsung.com> Reviewed-by: Geon-ho Kim <gh007.kim@samsung.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-04-06rtld/dl-version.c: Add debug for missing load and libcManinder Singh
2015-04-06 Mark Hatle <mark.hatle@windriver.com> Maninder Singh <maninder1.s@samsung.com> * src/rtld/dl-version.c: Add debug for mising ld-linux or libc During cross prelink if we miss out ld-linux.so.* or libc.so.* It prints below info: ./prelink: /test_binary: Could not parse `prelink-rtld: dl-version.c:219: rtld_check_map_versions: Assertion `needed != ((void *)0)' failed.' And thus we miss actual cause for this failure, by this patch we will know failure reason. ./prelink: /test_binary: Could not parse `./prelink-rtld: error while loading shared libraries: ld-linux.so.3' (In this case ld-linux.so.3 was missing) Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Vaneet Narang <v.narang@samsung.com> Reviewed-by: Ajeet Yadav <ajeet.v@samsung.com> Reviewed-by: Geon-ho Kim <gh007.kim@samsung.com> Changed the exit code to 1. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2015-04-06src/get.c: Remove extra check for ld-linux.so.3 in strcmpMark Hatle
2015-03-31 Mark Hatle <mark.hatle@windriver.com> * Based on submission by Maninder Singh <maninder1.s@samsung.com> src/get.c: Remove extra check for ld-linux.so.3 in strcmp (remove first entry, second is already in upstream code) The original submission removed the second entry, maintaining the first. I choose to remove the first entry, and maintain the second as that more closely matches the upstream prelink project and helps remove a minor difference. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
2014-12-10testsuite/Makefile.am: Fix tests for latest autotoolsMark Hatle
2014-12-10 Mark Hatle <mark.hatle@windriver.com> * testsuite/Makefile.am: latest autotools has changed the way TEST_ENVIRONMENT is defined. Remove the $(SHELL) Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-12-10.gitignore: Add common filesMark Hatle
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-12-10src/rtld: Sync to latest glibc-2.20 rtldMark Hatle
2014-12-10 Mark Hatle <mark.hatle@windriver.com> * Resync src/rtld to glibc-2.20 * src/elf.h, src/rtld/rtld.c, src/rtld/dl-tls.c: Update elf.h to glibc 2.20 version Add basic aarch64 support (do_relocs): fix comparison pltrel_end >= rel_end Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-12-10src/rtld: Setup to prepare for glibc-2.20 resyncMark Hatle
2014-12-10 Mark Hatle <mark.hatle@windriver.com> * src/rtld/COPYING, src/rtld/COPYING.LIB, src/rtld/ChangeLog, src/rtld/README-rtld: Add local history information to setup for a resync to glibc-2.20 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-12-10arm: Specifically switch the dynamic linker on hard float ABI ARM systemsJon Masters
Original patch is from Fedora: http://marc.info/?l=fedora-arm&m=135417053128837&w=2 The prelink utility currently has the notion that a given architecture will have only one possible dynamic_linker path. Unfortunately, on ARM, we have two ABIs that might be in use, depending upon hard or soft float ABI use. Fortunately, prelink is aware of the linker possibilities so will not fall over like on SPARC, since it will match on either of the linker paths when matching the linker, but when examining ELF headers, it throws a (harmless-ish) warning on ARMv7 that this patch removes. Signed-off-by: Jon Masters <jcm@jonmasters.org> cross-prelinker supports two dynamic linkers. I adjusted the patch to replace the old OABI linker, as it's no longer commonly used. 2014-12-09 Jon Masters <jcm@jonmasters.org> Mark Hatle <mark.hatle@windriver.com> * src/arch-arm.c: Remove support for OABI arm ld-linux.so.2 Add support for hard float ld-linux-armhf.so.3 * src/rtld/rtld.c: Add ld-linux-armhf.so.3 as a ldso name Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-08-25Implement IFUNC supportYasir-Khan
See: https://bugzilla.redhat.com/show_bug.cgi?id=1009601 2014-08-13 Kyle McMartin <kmcmartin@redhat.com> Jakub Jelinek <jakub@redhat.com> Julian Brown <julian@codesourcery.com> * testsuite/ifunc.h: Add ARM support. * src/prelink.h (R_ARM_IRELATIVE): Define. * src/arch-arm.c (arm_adjust_rel, arm_adjust_rela) (arm_prelink_rel, arm_prelink_rela, arm_apply_conflict_rela) (arm_rela_to_rel, arm_rel_to_rela, arm_undo_prelink_rel): Handle R_ARM_IRELATIVE. (arm_prelink_conflict_rel, arm_prelink_conflict_rela): Handle R_ARM_IRELATIVE, ifunc conflicts. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Yasir-Khan <yasir_khan@mentor.com> (original patch modified to apply) Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-07-22Always create a conflict for R_ARM_TLS_DESC relocsMaciej W. Rozycki
This is a bit obscure. In my testing, for the purpose of upstreaming, of the glibc change to support ARM TLS descriptors in prelinked binaries (cf upstream BZ #17078, https://sourceware.org/bugzilla/show_bug.cgi?id=17078) I have come across a problem where all programs prelinked against glibc binaries using ARM TLS descriptors themselves segfaulted in the normal exit path, where libc.so's own TLS destructors are called. I have tracked it down to the GOT entry (pointed to by the DT_TLSDESC_GOT dynamic tag) meant to point to the lazy TLS descriptor resolver (pointed to by the DT_TLSDESC_PLT dynamic tag) being left uninitialised and therefore NULL. An attempt to call that resolver caused therefore a segfault. The cause of this lack of initialisation turned out to be an omission in the original fix (dated 2011-04-13 in ChangeLog.cross), that didn't ensure that a conflict entry is created even for these R_ARM_TLS_DESC relocations that refer to a local symbol. Somehow it didn't trigger in testing back when implemented, perhaps glibc didn't require or access the missing entry in code handling TLS destructors then. Such an entry is needed, because for prelinked binaries the DT_TLSDESC_GOT GOT entry is only initialised by the dynamic linker when a conflict is resolved. The change below enforces this conflict entry creation. This fix removes 33 failures in prelink testing with glibc built using ARM TLS descriptors, that is with the `-mtls-dialect=gnu2' GCC option in effect (that is not the default unless explicitly requested at GCC build time): FAIL -> PASS: default/prelink.sum:cxx1.sh FAIL -> PASS: default/prelink.sum:cxx2.sh FAIL -> PASS: default/prelink.sum:cxx3.sh FAIL -> PASS: default/prelink.sum:layout1.sh FAIL -> PASS: default/prelink.sum:layout2.sh FAIL -> PASS: default/prelink.sum:reloc1.sh FAIL -> PASS: default/prelink.sum:reloc10.sh FAIL -> PASS: default/prelink.sum:reloc11.sh FAIL -> PASS: default/prelink.sum:reloc2.sh FAIL -> PASS: default/prelink.sum:reloc3.sh FAIL -> PASS: default/prelink.sum:reloc4.sh FAIL -> PASS: default/prelink.sum:reloc5.sh FAIL -> PASS: default/prelink.sum:reloc6.sh FAIL -> PASS: default/prelink.sum:reloc7.sh FAIL -> PASS: default/prelink.sum:reloc8.sh FAIL -> PASS: default/prelink.sum:reloc9.sh FAIL -> PASS: default/prelink.sum:shuffle1.sh FAIL -> PASS: default/prelink.sum:shuffle2.sh FAIL -> PASS: default/prelink.sum:shuffle3.sh FAIL -> PASS: default/prelink.sum:shuffle4.sh FAIL -> PASS: default/prelink.sum:shuffle5.sh FAIL -> PASS: default/prelink.sum:shuffle6.sh FAIL -> PASS: default/prelink.sum:shuffle7.sh FAIL -> PASS: default/prelink.sum:shuffle8.sh FAIL -> PASS: default/prelink.sum:shuffle9.sh FAIL -> PASS: default/prelink.sum:tls1.sh FAIL -> PASS: default/prelink.sum:tls2.sh FAIL -> PASS: default/prelink.sum:tls3.sh FAIL -> PASS: default/prelink.sum:tls4.sh FAIL -> PASS: default/prelink.sum:tls5.sh FAIL -> PASS: default/prelink.sum:tls6.sh FAIL -> PASS: default/prelink.sum:tls7.sh FAIL -> PASS: default/prelink.sum:undo1.sh 2014-07-22 Maciej W. Rozycki <macro@codesourcery.com> * src/arch-arm.c (arm_prelink_conflict_rel): Always create a conflict for R_ARM_TLS_DESC relocs. (arm_prelink_conflict_rela): Likewise. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-10-15Merge to upstream r209Mark Hatle
2013-10-15 Mark Hatle <mark.hatle@windriver.com> * Merged to upstream r209 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-10-15 * src/arch-s390.c (s390_prelink_conflict_rela): For R_390_IRELATIVE,jakub
always use that relocation type in the conflict section. git-svn-id: http://sourceware.org/svn/prelink@209 94c539fb-cf18-0410-b60f-edeeb537fa16
2013-10-15 * testsuite/ifunc.h (IFUNC_ASM): Add s390x and s390 version.jakub
git-svn-id: http://sourceware.org/svn/prelink@208 94c539fb-cf18-0410-b60f-edeeb537fa16
2013-10-15 * src/arch-s390.c (s390_prelink_conflict_rela): Fix handling ofjakub
R_390_IRELATIVE. * src/arch-s390x.c (s390x_prelink_conflict_rela): Likewise. git-svn-id: http://sourceware.org/svn/prelink@207 94c539fb-cf18-0410-b60f-edeeb537fa16
2013-08-01 * doc/prelink.8 (--usage): Document it.jakub
(--layout-page-size=): Likewise. git-svn-id: http://sourceware.org/svn/prelink@206 94c539fb-cf18-0410-b60f-edeeb537fa16 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-08-01testsuite/unprel1.sh: Enable RUN_HOST for new test.Mark Hatle
2013-08-01 Mark Hatle <mark.hatle@windriver.com> * testsuite/unprel1.sh: Enable RUN_HOST for new test. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-08-01 * src/cache.c (prelink_save_cache_check): For ET_CACHE_DYN20130503jakub
or ET_UNPRELINKABLE dependencies, call prelink_save_cache_check recursively. * testsuite/Makefile.am (TESTS): Add unprel1.sh. * testsuite/Makefile.in: Regenerated. * testsuite/unprel1.sh: New test. * testsuite/unprel1.c: New file. * testsuite/unprel1lib1.c: New file. * testsuite/unprel1lib2.c: New file. git-svn-id: http://sourceware.org/svn/prelink@205 94c539fb-cf18-0410-b60f-edeeb537fa16 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-08-01 * src/prelink.h (R_390_IRELATIVE): Define if not defined.jakub
git-svn-id: http://sourceware.org/svn/prelink@204 94c539fb-cf18-0410-b60f-edeeb537fa16 Fix conflict Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-08-01 * src/arch-s390.c (s390_adjust_rela, s390_prelink_rela,jakub
s390_apply_conflict_rela, s390_prelink_conflict_rela, s390_undo_prelink_rela): Handle R_390_IRELATIVE. * src/arch-s390x.c (s390x_adjust_rela, s390x_prelink_rela, s390x_apply_conflict_rela, s390x_prelink_conflict_rela, s390x_undo_prelink_rela, s390x_reloc_size): Likewise. git-svn-id: http://sourceware.org/svn/prelink@203 94c539fb-cf18-0410-b60f-edeeb537fa16 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-04-23README.cross: Add patch submission informationMark Hatle
2013-04-23 Mark Hatle <mark.hatle@windriver.com> * README.cross: Add patch submission information based on a suggestion from Tom de Vries. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>