-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prelink section ordering on subsequent prelink
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 <[email protected]> 2016-06-03 Dave Lerner <[email protected]> * src/exec.c: New check_reorder_needed, section_reorder_fix functions Signed-off-by: Mark Hatle <[email protected]>
- Loading branch information
Dave Lerner
authored and
Mark Hatle
committed
Jun 3, 2016
1 parent
5cb7a3e
commit 33be255
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
2016-06-03 Dave Lerner <[email protected]> | ||
* src/exec.c: New check_reorder_needed, section_reorder_fix functions | ||
|
||
2016-03-22 Mark Hatle <[email protected]> | ||
* src/gather.c, src/get.c: Fix LD_PRELOAD | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters