aboutsummaryrefslogtreecommitdiffstats
path: root/src/exec.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>
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>
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-1820060522jakub
git-svn-id: http://sourceware.org/svn/prelink@130 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-1820040304jakub
git-svn-id: http://sourceware.org/svn/prelink@108 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820040216jakub
git-svn-id: http://sourceware.org/svn/prelink@107 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820031006jakub
git-svn-id: http://sourceware.org/svn/prelink@95 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030808jakub
git-svn-id: http://sourceware.org/svn/prelink@91 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030807jakub
git-svn-id: http://sourceware.org/svn/prelink@90 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030630jakub
git-svn-id: http://sourceware.org/svn/prelink@87 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030627jakub
git-svn-id: http://sourceware.org/svn/prelink@86 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030626jakub
git-svn-id: http://sourceware.org/svn/prelink@85 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820030522jakub
git-svn-id: http://sourceware.org/svn/prelink@75 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820021204jakub
git-svn-id: http://sourceware.org/svn/prelink@62 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020827jakub
git-svn-id: http://sourceware.org/svn/prelink@54 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020613jakub
git-svn-id: http://sourceware.org/svn/prelink@48 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020612jakub
git-svn-id: http://sourceware.org/svn/prelink@47 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820020609jakub
git-svn-id: http://sourceware.org/svn/prelink@44 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820011009jakub
git-svn-id: http://sourceware.org/svn/prelink@36 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820011007jakub
git-svn-id: http://sourceware.org/svn/prelink@35 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010930jakub
git-svn-id: http://sourceware.org/svn/prelink@31 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010921jakub
git-svn-id: http://sourceware.org/svn/prelink@27 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010918jakub
git-svn-id: http://sourceware.org/svn/prelink@26 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-1820010907jakub
git-svn-id: http://sourceware.org/svn/prelink@21 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010829jakub
git-svn-id: http://sourceware.org/svn/prelink@19 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010827jakub
git-svn-id: http://sourceware.org/svn/prelink@18 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010717jakub
git-svn-id: http://sourceware.org/svn/prelink@15 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010716jakub
git-svn-id: http://sourceware.org/svn/prelink@14 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010713jakub
git-svn-id: http://sourceware.org/svn/prelink@13 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010704jakub
git-svn-id: http://sourceware.org/svn/prelink@10 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010703jakub
git-svn-id: http://sourceware.org/svn/prelink@9 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010702jakub
git-svn-id: http://sourceware.org/svn/prelink@8 94c539fb-cf18-0410-b60f-edeeb537fa16
2006-07-1820010614jakub
git-svn-id: http://sourceware.org/svn/prelink@2 94c539fb-cf18-0410-b60f-edeeb537fa16