Commit Graph

764 Commits

Author SHA1 Message Date
dependabot[bot]
d9c827cb62 Bump actions/download-artifact from 2 to 3
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-16 06:21:36 +00:00
dependabot[bot]
248cabac7a Bump docker/setup-qemu-action from 1 to 2
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-16 06:21:32 +00:00
Jörg Thalheim
da890c4486 Merge pull request #385 from NixOS/dependabot
add dependabot
2022-07-16 08:21:13 +02:00
Jörg Thalheim
fcb9ca697a add dependabot 2022-07-16 08:20:55 +02:00
Jörg Thalheim
35c1934c2d Merge pull request #383 from NixOS/compiler-check
add compiler check for c++17
2022-07-16 08:12:30 +02:00
Jörg Thalheim
e89d02f33d add compiler check for c++17 2022-07-16 08:05:26 +02:00
Jörg Thalheim
4900800256 fix version file 0.15.0 2022-07-16 07:22:27 +02:00
Jörg Thalheim
48707416c4 bump version 2022-07-16 07:19:00 +02:00
Dmitry Moskalchuk
5cabf09f9e Remove unnecessary check of ELF type before modifying OS ABI
Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
2022-07-11 10:27:10 +03:00
Dmitry Moskalchuk
5a16d88631 Skip writing if the requested OS ABI is the same as the current one
Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
2022-06-30 15:19:07 +03:00
Dmitry Moskalchuk
db2ad5ef92 Add --print-os-abi and --set-os-abi options
This commit adds an ability to print and change the EI_OSABI field
of the ELF header.

Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
2022-06-30 14:38:53 +03:00
Jörg Thalheim
734daa3d0f Merge pull request #380 from amjoseph-nixpkgs/pr/close/368
patchelf.cc: handle DT_MIPS_XHASH and .MIPS.xhash
2022-06-29 20:42:34 +02:00
Jörg Thalheim
a8dcbc9c06 Merge pull request #378 from a-m-joseph/pr/no-sort
add --no-sort option
2022-06-19 06:54:15 +01:00
Adam Joseph
7b155fda31 formatting: fix incorrect indentation in previous commit 2022-06-18 22:44:04 -07:00
Adam Joseph
cad0212309 patchelf.1: mention new --no-sort option 2022-06-18 22:42:16 -07:00
Jörg Thalheim
1eeac3826c Merge pull request #379 from a-m-joseph/pr/dt_mips_rld_map_rel-comment
patchelf.cc: add comment explaining calculation for DT_MIPS_RLD_MAP_REL
2022-06-19 06:31:55 +01:00
Adam Joseph
820da7be8d patchelf.cc: handle DT_MIPS_XHASH and .MIPS.xhash
glibc changed their ABI in commit
23c1c256ae7b0f010d0fcaff60682b620887b164 on 2019-Aug-29, by changing
the structure of the .gnu.hash data on MIPS and moving it to a
different section.  We need to adapt to this change by glibc.

Closes #368
2022-06-18 21:51:19 -07:00
Adam Joseph
8db45c6a0c elf.h: resynchronize with glibc elf.h
This commit adds two symbols (SHT_MIPS_XHASH and DT_MIPS_XHASH) found
in glibc, and updates the value of DT_MIPS_NUM.  These changes were
made to glibc in 23c1c256ae7b0f010d0fcaff60682b620887b164 on
29-Aug-2019.
2022-06-18 21:51:19 -07:00
Adam Joseph
84275a0950 patchelf.cc: add comment explaining calculation for DT_MIPS_RLD_MAP_REL
This commit also includes a link to the best source I could find for
what DT_MIPS_RLD_MAP_REL is supposed to be, an exact copy-paste of the
text found there, and step-by-step algebra for deriving the formula
used by the code.  Hopefully this means that this is the end of the
DT_MIPS_RLD_MAP_REL headaches.
2022-06-18 18:40:39 -07:00
Adam Joseph
9995113a40 add --no-sort option
This PR adds a command line option `--no-sort` which causes patchelf
to refrain from sorting the program headers and section headers.  A
comment in the preexisting source code says that this was done only
"for neatness".

The `--no-sort` option, combined with `readelf -a` and `colordiff` is
very useful for debugging patchelf problems.  Without `--no-sort` the
diffs are not usable -- everything changes because of the sorting.
2022-06-18 18:39:35 -07:00
Jörg Thalheim
be0cc30a59 Merge pull request #376 from ehmry/null-rpath
modifyRPath: return early if new and old rpath are empty
2022-05-20 17:51:33 +01:00
Emery Hemingway
761b494a9f modifyRPath: return early if new and old rpath are empty 2022-05-20 10:51:19 -05:00
Jörg Thalheim
309806c011 Merge pull request #375 from klemensn/document-print-needed
Document --print-needed
2022-05-11 19:40:36 +01:00
Klemens Nanni
8a633bd31d Document --print-needed
`--help` output has already.
2022-05-03 19:44:14 +02:00
Jörg Thalheim
31d052c1fd Merge pull request #372 from JagoGyselinck/master
Add O_BINARY flag when opening files to allow compilation for Windows
2022-04-07 07:26:17 +01:00
Jörg Thalheim
676326c0cf Update src/patchelf.cc 2022-04-07 07:22:02 +01:00
Jago Gyselinck
a04ca83ad7 Add O_BINARY flag when opening files to allow compilation for Windows 2022-04-06 15:27:33 +02:00
Jörg Thalheim
8f5ac59ade Merge pull request #367 from deadw00d/master
Add --add-debug option
2022-03-26 08:08:33 +00:00
deadwood
b92e442be0 Add test for --add-debug-tag argument 2022-02-23 16:42:51 +01:00
deadwood
86a2cd830f Add documentation for --add-debug-tag argument 2022-02-21 19:36:54 +01:00
deadwood
fd35bb9870 Update argument name to be more descriptive 2022-02-21 19:36:37 +01:00
Jörg Thalheim
a350545042 bump version 0.14.5 2022-02-21 14:26:56 +01:00
Jörg Thalheim
df7c57a032 bump version 0.14.4 2022-02-21 14:22:56 +01:00
deadwood
c6c4304ed6 Add --add-debug option
A shared library (-shared) by default does not receive DT_DEBUG tag.
This means that when a shared library has an entry point (so that it
can be run as an executable), the debugger does not connect to it
correctly and symbols are not resolved.

--add-debug option adds DT_DEBUG tag if it not yet present to an ELF
object.
2022-02-20 11:32:45 +01:00
Jörg Thalheim
a992616722 Merge pull request #365 from a-m-joseph/master
fix incorrect polarity on dyn_offset; closes #364
2022-02-05 07:35:34 +00:00
Eelco Dolstra
8fc7020015 Merge pull request #366 from bjornfor/fix-typo
Fix typo: s/folllow/follow/
2022-02-01 12:59:37 +01:00
Bjørn Forsman
d881452fd3 Fix typo: s/folllow/follow/ 2022-01-31 19:27:30 +01:00
Adam Joseph
457d297922 fix incorrect polarity on dyn_offset; closes #364 2022-01-21 23:37:20 -08:00
Jörg Thalheim
bdb09e90f7 Merge pull request #362 from fzakaria/faridzakaria/musl-flake
Add support to build with musl
2021-12-23 05:36:39 +00:00
Farid Zakaria
15a12d81f0 Make the develop point to the patchelf packages directly.
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2021-12-22 14:15:17 -05:00
Farid Zakaria
8aabe512bc Augmented README.md for new develop & build instructions 2021-12-22 09:50:59 -08:00
Farid Zakaria
03385bca80 Added musl devshell 2021-12-22 09:44:14 -08:00
Farid Zakaria
50d4335374 Add support to build with musl
Add support to the flake.nix to build with musl
```
nix build .#patchelf-musl
```
2021-12-22 08:59:14 -08:00
Jörg Thalheim
3d0a58ba10 Merge pull request #361 from fzakaria/faridzakaria/fix-add-replace-for-real
Allow multiple modifications in same call
2021-12-22 05:13:26 +00:00
Farid Zakaria
b92a6e8951 Fix replace-add-needed.sh test for musl 2021-12-21 14:30:45 -08:00
Farid Zakaria
e589fe3387 Merge branch 'master' into faridzakaria/fix-add-replace-for-real 2021-12-21 14:15:52 -08:00
Jörg Thalheim
c172ce6efb Merge pull request #360 from fzakaria/faridzakaria/fix-add-replace
Quality of life readability improvements
2021-12-21 19:47:20 +00:00
Farid Zakaria
4604393fd6 Renamed findSection2 to tryFindSectionHeader 2021-12-21 10:29:03 -08:00
Farid Zakaria
d02a3ecdd7 Code clarity and test working with musl
Made changes according to feedback from @Mic92 such as moving the
`rewriteSections` inline into every method.

Improved `replace-add-needed.sh` to work with musl libc
2021-12-21 06:05:13 -08:00
Farid Zakaria
dc375bc7cd Remove result and add it to gitignore 2021-12-20 17:36:06 -08:00