Skip to content

Commit b49de1b

Browse files
authored
Merge pull request #616 from NixOS/0.18-maintenance
Merge `0.18-maintenance` into `master`
2 parents 7576030 + 795253a commit b49de1b

File tree

3 files changed

+106
-35
lines changed

3 files changed

+106
-35
lines changed

ChangeLog.md

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,51 @@
1-
## Release History
1+
# Release History
2+
3+
## 0.16.2 (Yet to be released)
4+
5+
The release combines the 0.15.1 through 0.15.4 backports with 0.16.1.
6+
7+
* Code quality and infra changes just like 0.15.{1,2}
8+
* Update to a later glibc `elf.h`, just like 0.15.4
9+
10+
## 0.16.1 (October 28, 2022)
11+
12+
This release only fixes the incorrect reported version by the 0.16.0 release.
13+
14+
## 0.16.0 (October 27, 2022)
15+
16+
Changes from 0.15.3:
17+
18+
* Add `--print-os-abi` and `--set-os-abi` options by @dmsck in https://github.com/NixOS/patchelf/pull/381
19+
* Sync `.note.gnu.property` to `PT_GNU_PROPERTY` by @Bo98 in https://github.com/NixOS/patchelf/pull/414
20+
* Rework file shifting to avoid sections crossing multiple segments by @Bo98 in https://github.com/NixOS/patchelf/pull/415
21+
22+
(These notes are the remainder of 0.16.0 that was not backported to 0.15.3.
23+
Originally, 0.16.0 was branched from 0.15.0, and those changes were fresh in this release, having never been backported.)
24+
25+
## 0.15.5 (August 12, 2025)
26+
27+
Bugfix backports from 0.18.0:
28+
29+
* Adjust `roundUp` for 0 as input by @cgzones in https://github.com/NixOS/patchelf/pull/466
30+
31+
Bugfix backports from 0.17.{0, 1}:
32+
33+
* Fix page size constants for Itanium and SPARC.
34+
* Fix Out-of-bounds read in the function `modifySoname` by @yairKoskas in https://github.com/NixOS/patchelf/pull/451
35+
36+
## 0.15.4 (August 12, 2025)
37+
38+
* Update to a later glibc `elf.h`.
39+
40+
This should not result in any behavioral changes, except for possibly better architecture-specific support.
41+
42+
## 0.15.3 (August 12, 2025)
43+
44+
This is a backport release made from the simplest fixes from 0.16.0.
45+
46+
* Handle `glibc-hwcaps` on `ppc64le` on CentOS/RHEL/Rocky 8 for `tests/replace-add-needed.sh` (fixes #406) by @robert-scheck in https://github.com/NixOS/patchelf/pull/407
47+
* Fix Out-of-bounds read in the function `modifyRPath` by @xiaoxiaoafeifei in https://github.com/NixOS/patchelf/pull/419
48+
* Fix out of bounds access when increasing program header table by @Bo98 in https://github.com/NixOS/patchelf/pull/411
249

350
## 0.15.2 (August 12, 2025)
451

@@ -18,13 +65,13 @@ The behavior of this version should be essentially the same as 0.15.0.
1865

1966
## 0.15.0 (July 16, 2022)
2067

21-
* Add --add-debug option by @deadw00d in https://github.com/NixOS/patchelf/pull/367
22-
* Add O_BINARY flag when opening files to allow compilation for Windows by @JagoGyselinck in https://github.com/NixOS/patchelf/pull/372
23-
* Document --print-needed by @klemensn in https://github.com/NixOS/patchelf/pull/375
68+
* Add `--add-debug` option by @deadw00d in https://github.com/NixOS/patchelf/pull/367
69+
* Add `O_BINARY flag` when opening files to allow compilation for Windows by @JagoGyselinck in https://github.com/NixOS/patchelf/pull/372
70+
* Document `--print-needed` by @klemensn in https://github.com/NixOS/patchelf/pull/375
2471
* modifyRPath: return early if new and old rpath are empty by @ehmry in https://github.com/NixOS/patchelf/pull/376
25-
* Add comment explaining calculation for DT_MIPS_RLD_MAP_REL by @amjoseph-nixpkgs in https://github.com/NixOS/patchelf/pull/379
26-
* Add --no-sort option by @amjoseph-nixpkgs in https://github.com/NixOS/patchelf/pull/378
27-
* Handle DT_MIPS_XHASH and .MIPS.xhash by @amjoseph-nixpkgs in https://github.com/NixOS/patchelf/pull/380
72+
* Add comment explaining calculation for `DT_MIPS_RLD_MAP_REL` by @amjoseph-nixpkgs in https://github.com/NixOS/patchelf/pull/379
73+
* Add `--no-sort option` by @amjoseph-nixpkgs in https://github.com/NixOS/patchelf/pull/378
74+
* Handle `DT_MIPS_XHASH` and `.MIPS.xhash` by @amjoseph-nixpkgs in https://github.com/NixOS/patchelf/pull/380
2875

2976
## 0.14.5 (February 21, 2022)
3077

@@ -36,7 +83,7 @@ The behavior of this version should be essentially the same as 0.15.0.
3683
* Allow multiple modifications in same call by @fzakaria in https://github.com/NixOS/patchelf/pull/361
3784
* Add support to build with musl by @fzakaria in https://github.com/NixOS/patchelf/pull/362
3885
* Fix typo: s/folllow/follow/ by @bjornfor in https://github.com/NixOS/patchelf/pull/366
39-
* mips: fix incorrect polarity on dyn_offset; closes #364 by @a-m-joseph in https://github.com/NixOS/patchelf/pull/365
86+
* mips: fix incorrect polarity on `dyn_offset`; closes #364 by @a-m-joseph in https://github.com/NixOS/patchelf/pull/365
4087

4188
## 0.14.3 (December 05, 2021)
4289

@@ -55,13 +102,13 @@ The behavior of this version should be essentially the same as 0.15.0.
55102
Changes compared to 0.13:
56103

57104
* Bug fixes:
58-
- Fix corrupted library names when using --replace-needed multiple times
105+
- Fix corrupted library names when using `--replace-needed` multiple times
59106
- Fix setting an empty rpath
60-
- Don't try to parse .dynamic section of type NOBITS
61-
- Fix use-after-free in normalizeNoteSegments
62-
- Correct EINTR handling in writeFile
63-
- MIPS: Adjust PT_MIPS_ABIFLAGS segment and DT_MIPS_RLD_MAP_REL dynamic section if present
64-
- Fix binaries without .gnu.hash section
107+
- Don't try to parse `.dynamic section` of type `NOBITS`
108+
- Fix use-after-free in `normalizeNoteSegments`
109+
- Correct `EINTR` handling in writeFile
110+
- MIPS: Adjust `PT_MIPS_ABIFLAGS` segment and `DT_MIPS_RLD_MAP_REL` dynamic section if present
111+
- Fix binaries without `.gnu.hash` section
65112
* Support loongarch architecture
66113
* Remove limits on output file size for elf files
67114
* Allow reading rpath from file
@@ -72,12 +119,12 @@ Changes compared to 0.13:
72119
* Bug fixes:
73120
- fix setting empty rpath
74121
- use memcpy instead of strcpy to set rpath
75-
- Don't try to parse .dynamic section of type NOBITS
76-
- fix use-after-free in normalizeNoteSegments
77-
- correct EINTR handling in writeFile
78-
- Adjust PT_MIPS_ABIFLAGS segment if present
79-
- Adjust DT_MIPS_RLD_MAP_REL dynamic section entry if present
80-
- fix binaries without .gnu.hash section
122+
- Don't try to parse `.dynamic section` of type `NOBITS`
123+
- fix use-after-free in `normalizeNoteSegments`
124+
- correct `EINTR` handling in writeFile
125+
- Adjust `PT_MIPS_ABIFLAGS` segment if present
126+
- Adjust `DT_MIPS_RLD_MAP_REL` dynamic section entry if present
127+
- fix binaries without `.gnu.hash` section
81128

82129
## 0.13 (August 5, 2021)
83130

@@ -105,7 +152,7 @@ Changes compared to 0.13:
105152

106153
* Many bug fixes. Please refer to the Git commit log:
107154

108-
https://github.com/NixOS/patchelf/commits/master
155+
https://github.com/NixOS/patchelf/commits/0.10
109156

110157
This release has contributions from Adam Trhoň, Benjamin Hipple,
111158
Bernardo Ramos, Bjørn Forsman, Domen Kožar, Eelco Dolstra, Ezra
@@ -117,7 +164,7 @@ Changes compared to 0.13:
117164

118165
* Lots of new features. Please refer to the Git commit log:
119166

120-
https://github.com/NixOS/patchelf/commits/master
167+
https://github.com/NixOS/patchelf/commits/0.9
121168

122169
This release has contributions from Aaron D. Marasco, Adrien
123170
Devresse, Alexandre Pretyman, Changli Gao, Chingis Dugarzhapov,
@@ -134,7 +181,7 @@ Changes compared to 0.13:
134181
* Rewrite section indices in symbol tables. This for instance allows
135182
gdb to show proper backtraces.
136183

137-
* Added `--remove-needed' option.
184+
* Added `--remove-needed` option.
138185

139186
## 0.6 (November 7, 2011)
140187

@@ -150,7 +197,7 @@ Changes compared to 0.13:
150197

151198
* Various bugfixes.
152199

153-
* `--force-rpath' now deletes the DT_RUNPATH if it is present.
200+
* `--force-rpath` now deletes the `DT_RUNPATH` if it is present.
154201

155202
## 0.4 (June 4, 2008)
156203

@@ -160,18 +207,18 @@ Changes compared to 0.13:
160207

161208
* FreeBSD support.
162209

163-
* `--set-rpath', `--shrink-rpath' and `--print-rpath' now prefer
164-
DT_RUNPATH over DT_RPATH, which is obsolete. When updating, if both
165-
are present, both are updated. If only DT_RPATH is present, it is
166-
converted to DT_RUNPATH unless `--force-rpath' is specified. If
167-
neither is present, a DT_RUNPATH is added unless `--force-rpath' is
168-
specified, in which case a DT_RPATH is added.
210+
* `--set-rpath`, `--shrink-rpath` and `--print-rpath` now prefer
211+
`DT_RUNPATH` over `DT_RPATH`, which is obsolete. When updating, if both
212+
are present, both are updated. If only `DT_RPATH` is present, it is
213+
converted to `DT_RUNPATH` unless `--force-rpath` is specified. If
214+
neither is present, a `DT_RUNPATH` is added unless `--force-rpath` is
215+
specified, in which case a `DT_RPATH` is added.
169216

170217
## 0.3 (May 24, 2007)
171218

172-
* Support for 64-bit ELF binaries (such as on x86_64-linux).
219+
* Support for 64-bit ELF binaries (such as on `x86_64-linux`).
173220

174-
* Support for big-endian ELF binaries (such as on powerpc-linux).
221+
* Support for big-endian ELF binaries (such as on `powerpc-linux`).
175222

176223
* Various bugfixes.
177224

tests/invalid-elf.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh -u
1+
#! /bin/sh -ue
22

33
# Usage: killed_by_signal $?
44
#
@@ -18,6 +18,24 @@ TEST_DIR=$(dirname "$(readlink -f "$0")")/invalid-elf
1818
TEST_CASES="invalid-shrstrtab-idx invalid-shrstrtab-size invalid-shrstrtab-zero
1919
invalid-shrstrtab-nonterm invalid-shdr-name invalid-phdr-offset"
2020

21+
# Issue #64 regression test. Test ELF provided by issue submitter.
22+
TEST_CASES=$TEST_CASES' invalid-phdr-issue-64'
23+
24+
# shellcheck disable=SC2034
25+
invalid_shrstrtab_idx_MSG='data region extends past file end'
26+
# shellcheck disable=SC2034
27+
invalid_shrstrtab_size_MSG='data region extends past file end'
28+
# shellcheck disable=SC2034
29+
invalid_shrstrtab_zero_MSG='data region extends past file end'
30+
# shellcheck disable=SC2034
31+
invalid_shrstrtab_nonterm_MSG='data region extends past file end'
32+
# shellcheck disable=SC2034
33+
invalid_shdr_name_MSG='data region extends past file end'
34+
# shellcheck disable=SC2034
35+
invalid_phdr_offset_MSG='program header table out of bounds'
36+
# shellcheck disable=SC2034
37+
invalid_phdr_issue_64_MSG='program header table out of bounds'
38+
2139
FAILED_TESTS=""
2240

2341
for tcase in $TEST_CASES; do
@@ -26,10 +44,16 @@ for tcase in $TEST_CASES; do
2644
exit 1
2745
fi
2846

29-
../src/patchelf --output /dev/null "$TEST_DIR/$tcase"
30-
if killed_by_signal $?; then
47+
../src/patchelf --output /dev/null "$TEST_DIR/$tcase" && res=$? || res=$?
48+
if killed_by_signal "$res"; then
3149
FAILED_TESTS="$FAILED_TESTS $tcase"
3250
fi
51+
52+
var=$(echo "$tcase-MSG" | tr '-' '_')
53+
msg=
54+
eval "msg=\${$var}"
55+
../src/patchelf --output /dev/null "$TEST_DIR/$tcase" 2>&1 |
56+
grep "$msg" >/dev/null 2>/dev/null
3357
done
3458

3559
if [ -z "$FAILED_TESTS" ]; then
324 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)