aboutsummaryrefslogtreecommitdiffstats
path: root/src/dso.c
AgeCommit message (Collapse)Author
2019-06-24Detect PIE executables w/ COPY relocs, and prevent running over the sectionscross_prelink_stagingcross_prelinkMark Hatle
before the commit (a89297f08cda5ca48d21088891150e7ccc9ddac3) the system would report: COPY relocations don't point into .bss or .sbss section Now, it often reports: file offsets not monotonically increasing This was tracked down (using this debug code) to the .gnu.conflict section being added. In one example the offset ranges ended up being: ../src/prelink: section 15 .fini file offset range 000012f4 and 000012fd ../src/prelink: section 16 .gnu.conflict file offset range 00001300 and 00002080 ../src/prelink: section 17 .rodata file offset range 00002000 and 000020a3 ../src/prelink: section 18 .eh_frame_hdr file offset range 000020a4 and 00002118 This indicates that the new .gnu.conflict section overwrites .rodata by 0x80 bytes. This commit includes a check and error return for this condition. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2018-10-12x86_64: allow prelinking of PIE executables with COPY relocsSergei Trofimovich
COPY relocs are fine to have in PIE executables (as opposed to shared libraries). By enabling prelink on PIEs we achieve a few goals: - prelink more PIE files on system: nicer for uniformity, - avoid spurious warnings about shared libraries with COPY relocs It's usefult to prelink PIEs when kernel ASLR is disabled: kernel.randomize_va_space=0 + PIE-randomization patches. I have gcc built as `--enable-default-pie` (generates PIE executables by default). Testsute results before the change: PASS: 14 FAIL: 31 After the change: PASS: 32 FAIL: 13 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Added ChangeLog entry Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2018-08-29src/dso.c: use ehdr.e_shstrndx as indexRobert Yang
According to struct elf32_hd, the e_shnum is section header number, and the index is e_shstrndx, not e_shnum. This can fix segmention fault when handle libqb.so.0.18.2 from libqb_1.0.3. It fails to handle libqb.so.0.18.2 and get errors: Symbol section index outside of section numbers Then segmentation fault, this is because the e_shnum is 34, while e_shstrndx is 27 (it would be 33 when no errors), I've checked several elf files to confirm that the ones after e_shstrndx is NULL, so use e_shstrndx should be correct. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 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>
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>
2006-07-21Move code into trunk subdirectory.drow
git-svn-id: http://sourceware.org/svn/prelink@134 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820060712prelink_20060712jakub
git-svn-id: http://sourceware.org/svn/prelink@132 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820060621jakub
git-svn-id: http://sourceware.org/svn/prelink@131 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820060522jakub
git-svn-id: http://sourceware.org/svn/prelink@130 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820050729jakub
git-svn-id: http://sourceware.org/svn/prelink@126 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820050610jakub
git-svn-id: http://sourceware.org/svn/prelink@125 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820050207jakub
git-svn-id: http://sourceware.org/svn/prelink@123 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040931jakub
git-svn-id: http://sourceware.org/svn/prelink@118 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040929jakub
git-svn-id: http://sourceware.org/svn/prelink@117 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040907jakub
git-svn-id: http://sourceware.org/svn/prelink@115 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040505jakub
git-svn-id: http://sourceware.org/svn/prelink@110 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040317jakub
git-svn-id: http://sourceware.org/svn/prelink@109 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040129jakub
git-svn-id: http://sourceware.org/svn/prelink@106 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040127jakub
git-svn-id: http://sourceware.org/svn/prelink@105 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031209jakub
git-svn-id: http://sourceware.org/svn/prelink@103 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031118jakub
git-svn-id: http://sourceware.org/svn/prelink@102 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031028jakub
git-svn-id: http://sourceware.org/svn/prelink@100 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031027jakub
git-svn-id: http://sourceware.org/svn/prelink@99 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031009jakub
git-svn-id: http://sourceware.org/svn/prelink@96 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031006jakub
git-svn-id: http://sourceware.org/svn/prelink@95 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030811jakub
git-svn-id: http://sourceware.org/svn/prelink@92 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030630jakub
git-svn-id: http://sourceware.org/svn/prelink@87 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030616jakub
git-svn-id: http://sourceware.org/svn/prelink@84 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030515jakub
git-svn-id: http://sourceware.org/svn/prelink@74 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030502jakub
git-svn-id: http://sourceware.org/svn/prelink@71 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030217jakub
git-svn-id: http://sourceware.org/svn/prelink@69 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030210jakub
git-svn-id: http://sourceware.org/svn/prelink@66 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820021206jakub
git-svn-id: http://sourceware.org/svn/prelink@63 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820021204jakub
git-svn-id: http://sourceware.org/svn/prelink@62 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820021127jakub
git-svn-id: http://sourceware.org/svn/prelink@61 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020827jakub
git-svn-id: http://sourceware.org/svn/prelink@54 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020826jakub
git-svn-id: http://sourceware.org/svn/prelink@53 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020823jakub
git-svn-id: http://sourceware.org/svn/prelink@52 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020617jakub
git-svn-id: http://sourceware.org/svn/prelink@51 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020616jakub
git-svn-id: http://sourceware.org/svn/prelink@50 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020613jakub
git-svn-id: http://sourceware.org/svn/prelink@48 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020610jakub
git-svn-id: http://sourceware.org/svn/prelink@45 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820011007jakub
git-svn-id: http://sourceware.org/svn/prelink@35 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010921jakub
git-svn-id: http://sourceware.org/svn/prelink@27 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010917jakub
git-svn-id: http://sourceware.org/svn/prelink@25 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010914jakub
git-svn-id: http://sourceware.org/svn/prelink@24 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010913jakub
git-svn-id: http://sourceware.org/svn/prelink@23 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010830jakub
git-svn-id: http://sourceware.org/svn/prelink@20 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010724jakub
git-svn-id: http://sourceware.org/svn/prelink@17 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010717jakub
git-svn-id: http://sourceware.org/svn/prelink@15 94c539fb-cf18-0410-b60f-edeeb537fa16