summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
norly [Thu, 30 May 2013 03:01:51 +0000 (04:01 +0100)]
Redesign data structures, make basic reladd work.
The memory ELF model is now a tree structure:
ELF +--> PHDRs +--> PHDR +--> Section
| | +--> Section
| | ...
| | \--> Section
| |
| +--> PHDR +--> Section
| | ...
| ...
|
\--> Orphaned sections +--> Section
...
\--> Section
This effectively introduces semantics into the binary blob we are
editing, and allows us to re-layout its contents much more easily
while keeping as close as possible to what is assumed to be the
original semantics.
As a side-effect, a first meta-function had to be introduced
(elfu_mScnForall) in order to traverse all leaves of the tree.
Much old code has been removed given the leaner environment
available now, and automated insertion of .text and .data sections
from object files into executables now works. However nothing else
is inserted (such as string tables or .bss) and no relocation takes
place yet.
norly [Tue, 28 May 2013 22:34:51 +0000 (23:34 +0100)]
Implement orphaned sections
Orphaned sections are not (fully) included in any LOAD PHDR and can thus
be moved and stripped at will without changing the memory image of the
program.
norly [Tue, 28 May 2013 17:22:31 +0000 (18:22 +0100)]
Remove old and ugly printing functions
norly [Tue, 28 May 2013 17:18:55 +0000 (18:18 +0100)]
Add printing functions for models to ease debugging
norly [Mon, 27 May 2013 16:21:52 +0000 (17:21 +0100)]
Find PHDR -> PHDR dependencies
norly [Mon, 27 May 2013 15:40:31 +0000 (16:40 +0100)]
Only establish PHDR->Scn relationship for PT_LOAD
norly [Mon, 27 May 2013 13:53:33 +0000 (14:53 +0100)]
Restrict sh_link/sh_info evaluation where possible
norly [Mon, 27 May 2013 03:57:46 +0000 (04:57 +0100)]
Abstract model more - break 'make check'
Sections are now sorted by file offset and sh_link dependencies between
them as well as PHDR-SHDR dependencies are deduced as much as possible.
The downside is that while the output should still work just fine, 'make
check' fails to establish binary equivalence of input and output if the
section table is reordered. Thankfully, in normal GCC binaries it is
already ordered so we don't have to worry about this.
Unfortunately the ELF spec is very lax in this regard so we have to draw
a line ourselves.
norly [Mon, 27 May 2013 02:57:16 +0000 (03:57 +0100)]
Turn elfu_gPhdrContainsScn into a macro
norly [Mon, 27 May 2013 02:18:00 +0000 (03:18 +0100)]
Turn elfu_gScnSizeFile into a macro
norly [Sun, 26 May 2013 21:37:02 +0000 (22:37 +0100)]
Clean up loader code
norly [Sun, 26 May 2013 21:16:54 +0000 (22:16 +0100)]
Validate input at libelf level
This way we can just assume that stuff works later on and keep the code
clean and simple. It especially establishes that the file has a sane
format and is thus understandable and editable.
norly [Fri, 24 May 2013 23:46:12 +0000 (00:46 +0100)]
Be more verbose
norly [Fri, 24 May 2013 23:45:39 +0000 (00:45 +0100)]
Fix alignment error in mInsertSpaceBefore
norly [Fri, 24 May 2013 06:23:41 +0000 (07:23 +0100)]
Object file injection, first part
norly [Fri, 24 May 2013 02:48:14 +0000 (03:48 +0100)]
Move section-in-segment.c to generic/
norly [Fri, 24 May 2013 00:07:45 +0000 (01:07 +0100)]
Cleaner error handling with ELFU_WARN and ELFU_WARNELF
norly [Thu, 23 May 2013 23:45:06 +0000 (00:45 +0100)]
Use explicit libelf/* path in includes
norly [Sun, 24 Mar 2013 14:10:15 +0000 (15:10 +0100)]
Typos
norly [Fri, 22 Mar 2013 13:43:05 +0000 (13:43 +0000)]
Clean up file handling in main.c a bit
norly [Thu, 21 Mar 2013 18:23:57 +0000 (18:23 +0000)]
NOBITS expansion, for .bss etc
GNU binutils' readelf gets confused with symbol versions. More analysis
needed on that.
norly [Thu, 21 Mar 2013 00:41:08 +0000 (00:41 +0000)]
Copy section contents into newly allocated buffers
norly [Wed, 20 Mar 2013 21:06:29 +0000 (21:06 +0000)]
Typo
norly [Fri, 1 Mar 2013 18:59:57 +0000 (18:59 +0000)]
Implement mInsertAfter, for post-.data injection
norly [Wed, 27 Feb 2013 21:34:34 +0000 (21:34 +0000)]
Implement mInsertBefore, for pre-.interp injection
norly [Sun, 24 Feb 2013 14:02:25 +0000 (14:02 +0000)]
Add simple 'make check'
Uses elfedit to copy itself and ensure both versions are identical.
norly [Sat, 23 Feb 2013 16:08:26 +0000 (16:08 +0000)]
Refactor mdoel-related code
norly [Sat, 23 Feb 2013 15:59:12 +0000 (15:59 +0000)]
Clean up ELF-related files and functions
norly [Sat, 23 Feb 2013 15:47:53 +0000 (15:47 +0000)]
Merge {first,last}-section-in-segment.c
norly [Sat, 23 Feb 2013 15:45:17 +0000 (15:45 +0000)]
Move headers for ELF-based operations together
norly [Sat, 23 Feb 2013 15:41:35 +0000 (15:41 +0000)]
Move ELF-related files together
norly [Sat, 23 Feb 2013 15:36:30 +0000 (15:36 +0000)]
Remove ELFU_BOOL
norly [Sat, 23 Feb 2013 01:46:32 +0000 (01:46 +0000)]
Add run-time sanity checks
norly [Fri, 22 Feb 2013 18:35:12 +0000 (18:35 +0000)]
Use CIRCLEQ_FOREACH throughout
norly [Fri, 22 Feb 2013 16:58:14 +0000 (16:58 +0000)]
Add elfu_count{Section,PHDR}s
norly [Fri, 22 Feb 2013 16:51:58 +0000 (16:51 +0000)]
Remove --copy, do it whenever we have -o
norly [Tue, 12 Feb 2013 15:37:21 +0000 (15:37 +0000)]
Fix build on Ubuntu 12.04
Thanks to Cristian Cadar.
norly [Mon, 11 Feb 2013 01:10:27 +0000 (01:10 +0000)]
PHDR self-reference fixup function
norly [Mon, 11 Feb 2013 01:08:31 +0000 (01:08 +0000)]
Makefile: debug option - attach to running instance
norly [Sun, 10 Feb 2013 18:39:15 +0000 (18:39 +0000)]
Model to ELF (writing) support, copy functionality
norly [Sun, 10 Feb 2013 00:36:16 +0000 (00:36 +0000)]
First memory model of an ELF file
norly [Fri, 25 Jan 2013 15:24:36 +0000 (15:24 +0000)]
Print ELF header/segments/sections
norly [Fri, 25 Jan 2013 15:24:21 +0000 (15:24 +0000)]
Add .gitignore
norly [Fri, 25 Jan 2013 15:24:14 +0000 (15:24 +0000)]
Initial commit