Skip to content

Commit 7576030

Browse files
authored
Merge pull request #612 from NixOS/0.18-maintenance
Merge `0.18-maintenance` into `master`
2 parents 8b026d5 + 6d53678 commit 7576030

File tree

3 files changed

+189
-4
lines changed

3 files changed

+189
-4
lines changed

ChangeLog.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
## Release History
2+
3+
## 0.15.2 (August 12, 2025)
4+
5+
* In the autotools build system for the tests, pass a few more tool env vars in `TESTS_ENVIRONMENT`.
6+
7+
Some of them are not used yet (at all, or at least not in this backport to the `0.15-maintenance` branch), but at least `STRIP` is.
8+
9+
## 0.15.1 (August 12, 2025)
10+
11+
The objective is to prepare a very conservative patch release which can be bumped in Nixpkgs immediately.
12+
13+
* Backport infra changes from later master (August 2025)
14+
* Backport shellcheck fixes to test suite
15+
* Backport C++ code quality fixes (all of https://github.com/NixOS/patchelf/pull/464 but the final two commits)
16+
17+
The behavior of this version should be essentially the same as 0.15.0.
18+
19+
## 0.15.0 (July 16, 2022)
20+
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
24+
* 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
28+
29+
## 0.14.5 (February 21, 2022)
30+
31+
* fix faulty version in 0.14.4
32+
33+
## 0.14.4 (February 21, 2022)
34+
35+
* Several test fixes to fix patchelf test suite on openbsd by @klemensn
36+
* Allow multiple modifications in same call by @fzakaria in https://github.com/NixOS/patchelf/pull/361
37+
* Add support to build with musl by @fzakaria in https://github.com/NixOS/patchelf/pull/362
38+
* 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
40+
41+
## 0.14.3 (December 05, 2021)
42+
43+
* this release adds support for static, pre-compiled patchelf binaries
44+
45+
## 0.14.2 (November 29, 2021)
46+
47+
* make version number in tarball easier to use for packagers
48+
49+
## 0.14.1 (November 28, 2021)
50+
51+
* build fix: add missing include
52+
53+
## 0.14 (November 27, 2021)
54+
55+
Changes compared to 0.13:
56+
57+
* Bug fixes:
58+
- Fix corrupted library names when using --replace-needed multiple times
59+
- 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
65+
* Support loongarch architecture
66+
* Remove limits on output file size for elf files
67+
* Allow reading rpath from file
68+
* Requires now C++17 for building
69+
70+
## 0.13.1 (November 27, 2021)
71+
72+
* Bug fixes:
73+
- fix setting empty rpath
74+
- 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
81+
82+
## 0.13 (August 5, 2021)
83+
84+
* New `--add-rpath` flag.
85+
86+
* Bug fixes.
87+
88+
## 0.12 (August 27, 2020)
89+
90+
* New `--clear-symbol-version` flag.
91+
92+
* Better support for relocating NOTE sections/segments.
93+
94+
* Improved the default section alignment choice.
95+
96+
* Bug fixes.
97+
98+
## 0.11 (June 9, 2020)
99+
100+
* New `--output` flag.
101+
102+
* Some bug fixes.
103+
104+
## 0.10 (March 28, 2019)
105+
106+
* Many bug fixes. Please refer to the Git commit log:
107+
108+
https://github.com/NixOS/patchelf/commits/master
109+
110+
This release has contributions from Adam Trhoň, Benjamin Hipple,
111+
Bernardo Ramos, Bjørn Forsman, Domen Kožar, Eelco Dolstra, Ezra
112+
Cooper, Felipe Sateler, Jakub Wilk, James Le Cuirot, Karl Millar,
113+
Linus Heckemann, Nathaniel J. Smith, Richard Purdie, Stanislav
114+
Markevich and Tuomas Tynkkynen.
115+
116+
## 0.9 (February 29, 2016)
117+
118+
* Lots of new features. Please refer to the Git commit log:
119+
120+
https://github.com/NixOS/patchelf/commits/master
121+
122+
This release has contributions from Aaron D. Marasco, Adrien
123+
Devresse, Alexandre Pretyman, Changli Gao, Chingis Dugarzhapov,
124+
darealshinji, David Sveningsson, Eelco Dolstra, Felipe Sateler,
125+
Jeremy Sanders, Jonas Kuemmerlin, Thomas Tuegel, Tuomas Tynkkynen,
126+
Vincent Danjean and Vladimír Čunát.
127+
128+
## 0.8 (January 15, 2014)
129+
130+
* Fix a segfault caused by certain illegal entries in symbol tables.
131+
132+
## 0.7 (January 7, 2014)
133+
134+
* Rewrite section indices in symbol tables. This for instance allows
135+
gdb to show proper backtraces.
136+
137+
* Added `--remove-needed' option.
138+
139+
## 0.6 (November 7, 2011)
140+
141+
* Hacky support for executables created by the Gold linker.
142+
143+
* Support segments with an alignment of 0 (contributed by Zack
144+
Weinberg).
145+
146+
* Added a manual page (contributed by Jeremy Sanders
147+
148+
149+
## 0.5 (November 4, 2009)
150+
151+
* Various bugfixes.
152+
153+
* `--force-rpath' now deletes the DT_RUNPATH if it is present.
154+
155+
## 0.4 (June 4, 2008)
156+
157+
* Support for growing the RPATH on dynamic libraries.
158+
159+
* IA-64 support (not tested) and related 64-bit fixes.
160+
161+
* FreeBSD support.
162+
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.
169+
170+
## 0.3 (May 24, 2007)
171+
172+
* Support for 64-bit ELF binaries (such as on x86_64-linux).
173+
174+
* Support for big-endian ELF binaries (such as on powerpc-linux).
175+
176+
* Various bugfixes.
177+
178+
## 0.2 (January 15, 2007)
179+
180+
* Provides a hack to get certain programs (such as the
181+
Belastingaangifte 2005) to work.
182+
183+
## 0.1 (October 11, 2005)
184+
185+
* Initial release.

src/patchelf.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
10671067
debug("needed space is %d\n", neededSpace);
10681068

10691069
/* Calculate how many bytes are needed out of the additional pages. */
1070-
size_t extraSpace = neededSpace - startOffset;
1070+
size_t extraSpace = neededSpace - startOffset;
10711071
// Always give one extra page to avoid colliding with segments that start at
10721072
// unaligned addresses and will be rounded down when loaded
10731073
unsigned int neededPages = 1 + roundUp(extraSpace, getPageSize()) / getPageSize();
@@ -2152,7 +2152,7 @@ void ElfFile<ElfFileParamNames>::rebuildGnuHashTable(span<char> strTab, span<Elf
21522152
}
21532153

21542154
// Update bloom filters
2155-
std::fill(ght.m_bloomFilters.begin(), ght.m_bloomFilters.end(), 0);
2155+
std::fill(ght.m_bloomFilters.begin(), ght.m_bloomFilters.end(), 0);
21562156
for (size_t i = 0; i < entries.size(); ++i)
21572157
{
21582158
auto h = entries[i].hash;
@@ -2164,7 +2164,7 @@ void ElfFile<ElfFileParamNames>::rebuildGnuHashTable(span<char> strTab, span<Elf
21642164
}
21652165

21662166
// Fill buckets
2167-
std::fill(ght.m_buckets.begin(), ght.m_buckets.end(), 0);
2167+
std::fill(ght.m_buckets.begin(), ght.m_buckets.end(), 0);
21682168
for (size_t i = 0; i < entries.size(); ++i)
21692169
{
21702170
auto symBucketIdx = entries[i].bucketIdx;

src/patchelf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class ElfFile
283283
constexpr inline I wri(I & t, U i) const
284284
{
285285
I val = static_cast<I>(i);
286-
if (static_cast<U>(val) != i)
286+
if (static_cast<U>(val) != i)
287287
throw std::runtime_error { "value truncation" };
288288
t = rdi(val);
289289
return val;

0 commit comments

Comments
 (0)