Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | * Templatise the ElfFile class to take the Elf32_* types as | Eelco Dolstra | 2007-01-31 | 1 | -59/+74 |
| | | | | | | arguments. The idea is that we can just pass the Elf64_* types to get a 64-bit version of the class. | ||||
* | * Put the ELF operations in a class. | Eelco Dolstra | 2007-01-31 | 1 | -35/+77 |
| | |||||
* | * Print error messages on stderr. | Eelco Dolstra | 2007-01-31 | 1 | -2/+2 |
| | |||||
* | * --shrink-rpath doesn't take an argument. | Eelco Dolstra | 2007-01-18 | 1 | -1/+1 |
| | |||||
* | * Bump the version number. | Eelco Dolstra | 2007-01-15 | 1 | -1/+1 |
| | |||||
* | * DOH! | Eelco Dolstra | 2007-01-15 | 1 | -1/+1 |
| | |||||
* | * Mark as stable. | Eelco Dolstra | 2007-01-15 | 2 | -2/+2 |
| | |||||
* | * Release notes. | Eelco Dolstra | 2007-01-15 | 1 | -0/+12 |
| | |||||
* | * Hack: if we can't find .rel.dyn, use .rel.got. No idea if this | Eelco Dolstra | 2006-03-03 | 1 | -5/+20 |
| | | | | | makes sense. | ||||
* | * Bump the revision number to 0.2. | Eelco Dolstra | 2005-10-11 | 1 | -1/+1 |
| | |||||
* | * `--interpreter' -> `--set-interpreter'. | Eelco Dolstra | 2005-10-11 | 5 | -6/+6 |
| | |||||
* | * Add a README and a license. | Eelco Dolstra | 2005-10-11 | 3 | -0/+379 |
| | |||||
* | * A `--debug' flag. | Eelco Dolstra | 2005-10-04 | 2 | -16/+38 |
| | |||||
* | * Fix computation of the new start page. | Eelco Dolstra | 2005-10-03 | 1 | -15/+22 |
| | |||||
* | * Add a test for programs that crash when .dynstr etc. are moved. | Eelco Dolstra | 2005-10-03 | 3 | -7/+40 |
| | |||||
* | * Use a bigger maximum size. | Eelco Dolstra | 2005-10-02 | 1 | -1/+2 |
| | |||||
* | * Handle the case where no RPATH is present, so the .dynamic table has | Eelco Dolstra | 2005-10-01 | 4 | -77/+152 |
| | | | | | to be increased. | ||||
* | * Handle `--set-rpath' for the growing case. | Eelco Dolstra | 2005-09-30 | 4 | -22/+58 |
| | |||||
* | * `patchelf --set-rpath': short case. | Eelco Dolstra | 2005-09-30 | 3 | -19/+35 |
| | |||||
* | * Refactoring continued: `--shrink-rpath' works again. | Eelco Dolstra | 2005-09-30 | 1 | -134/+61 |
| | |||||
* | * Clear out trailing and padding space. | Eelco Dolstra | 2005-09-30 | 1 | -1/+6 |
| | |||||
* | * Revert. | Eelco Dolstra | 2005-09-30 | 1 | -1/+1 |
| | |||||
* | * Refactoring continued: `--set-interpreter' works again. | Eelco Dolstra | 2005-09-30 | 2 | -50/+92 |
| | |||||
* | * Start of refactoring to support growing the RPATH. | Eelco Dolstra | 2005-09-30 | 1 | -28/+207 |
| | |||||
* | * Doh! | Eelco Dolstra | 2005-09-30 | 1 | -1/+1 |
| | |||||
* | * Also try a interpreter with a long name. | Eelco Dolstra | 2005-09-30 | 3 | -6/+26 |
| | |||||
* | * Set a interpreter with a short name. | Eelco Dolstra | 2005-09-30 | 2 | -3/+3 |
| | |||||
* | * C++-ify. | Eelco Dolstra | 2005-09-30 | 2 | -97/+93 |
| | |||||
* | * Use a real programming language. | Eelco Dolstra | 2005-09-30 | 3 | -5/+7 |
| | |||||
* | * Don't use an impure test path. | Eelco Dolstra | 2005-09-29 | 1 | -1/+1 |
| | |||||
* | * Debug. | Eelco Dolstra | 2005-09-29 | 1 | -1/+1 |
| | |||||
* | * Add an operation `--print-rpath' to print the RPATH of the library | Eelco Dolstra | 2005-09-29 | 2 | -9/+19 |
| | | | | | or executable and exit. | ||||
* | * Put in a highly Nix-specific hack to make the tests work. | Eelco Dolstra | 2005-09-29 | 1 | -1/+1 |
| | |||||
* | * Add a failing test for `--set-rpath'. Test-driven development! | Eelco Dolstra | 2005-09-29 | 2 | -1/+23 |
| | |||||
* | * Added some real tests. | Eelco Dolstra | 2005-09-29 | 4 | -3/+58 |
| | |||||
* | * Added a flag `--print-interpreter' that prints the path of the | Eelco Dolstra | 2005-09-29 | 1 | -3/+16 |
| | | | | | executable's ELF interpreter on standard output and exits. | ||||
* | * Add dist files. | Eelco Dolstra | 2005-09-29 | 2 | -1/+4 |
| | |||||
* | * Add tests. | Eelco Dolstra | 2005-09-29 | 10 | -7/+63 |
| | |||||
* | * Document other people's bugs ;-) | Eelco Dolstra | 2005-09-29 | 1 | -0/+6 |
| | |||||
* | * Dummy commit. | Eelco Dolstra | 2005-08-23 | 1 | -1/+1 |
| | |||||
* | * Don't remove non-absolute paths from the RPATH like "$ORIGIN". | Eelco Dolstra | 2005-02-23 | 1 | -6/+16 |
| | |||||
* | * Keep same permissions, and handle the case where the file is | Eelco Dolstra | 2004-09-27 | 1 | -7/+21 |
| | | | | | read-only. | ||||
* | * Fix equality check. | Eelco Dolstra | 2004-09-27 | 2 | -471/+1 |
| | |||||
* | * Autoconfiscate patchelf. | Eelco Dolstra | 2004-09-24 | 5 | -13/+496 |
| | |||||
* | * The new interpreter can be specified with the `--interpreter | Eelco Dolstra | 2004-09-24 | 2 | -89/+256 |
| | | | | | | | | | FILENAME' switch. * Shrinking of the RPATH. The switch `--shrink-rpath' will cause all directories in the RPATH that don't actually contain libraries required by the executable to be removed from the RPATH. * Only grow the front of the executable if needed. | ||||
* | * Also move the section header table to the start of the file. | Eelco Dolstra | 2004-09-24 | 1 | -16/+22 |
| | |||||
* | * Dummy test program. | Eelco Dolstra | 2004-09-24 | 1 | -0/+9 |
| | |||||
* | * Made changing the ELF interpreter more robust. Previously I just | Eelco Dolstra | 2004-09-24 | 2 | -13/+108 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added the new PT_INTERP segment at the end of the file, which however makes it (typically) appear right in the middle of the (uninitialised) data segment. Worse, it wasn't guaranteed that the new segment was mapped into memory, and the dynamic loader does expect that. If the segment crossed or started beyond the last page of the last mapped segment, the program would crash. The "simple" solution is to add a PT_LOAD segment that maps the PT_INTERP segment into memory, but that creates a new problem, namely, that we then have to grow the program header table. Moving the program header table to the end of the file doesn't work, unfortunately, due to a bug in the Linux kernel: the address that it passes to the interpreter is wrong if there are holes or duplicates in the address space (it passes the base address + the program header table offset, instead of the virtual address specified in the PT_PHDR segment) - this is almost always the case due to the uninitialised part of the data segment which doesn't appear in the executable. The real solution used now is to move the entire contents of the executable one page (4096 bytes), put the new program header table (and the PT_INTERP segment) in the first page of the file thus created, add a PT_LOAD segment that starts one page before the original segments of the executable (typically 0x8047000 and 0x8048000, respectively), and adjust the internal offsets in the ELF header and program and section headers. The downside is that it makes all executables 4 KB larger. | ||||
* | * Bug fix. | Eelco Dolstra | 2004-09-24 | 1 | -2/+3 |
| | |||||
* | * Proof-of-concept of a tool to patch *existing* ELF executable to use | Eelco Dolstra | 2004-09-23 | 2 | -0/+133 |
our own glibc, to change the rpath, and so on. This enable us to use third-party programs in a pure Nix environment, and to "shrink" the rpath of Nix-built executables to contain only those directories that are actually needed (in order to reduce the number of retained dependencies). In order to use our own glibc, we have to set the executable's ELF interpreter field to our glib'c ld-linux.so instead of the typical /lib/ld-linux.so.2. The name of the interpreter is stored in the PT_INTERP segment of the executable. A complication is that this segment is too small to store the path to our ld-linux.so. We cannot just make this segment bigger, since the segment is actually mapped into the executable's virtual memory space, so that making it bigger will move all following segments in memory. That would break executables, since they are typically not position-independant (they expect to be loaded at specific addresses in memory). The solution is to add a *new* segment at the end of the executable. (The data containing the original PT_INTERP segment becomes "dead" space within the executable.) This seems to work: e.g., I've succesfully patched SuSE's /bin/cat. Something similar could be done for the rpath, although that's a bit more complicated since the rpath string is stored indirectly (the PT_DYNAMIC segment merely contains a pointer to a string in the DT_STRTAB section of the executable, which we cannot grow either, so we would have to copy it to the end of the file). |