mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Revert changes in r312891 and go back to stock lld code for rounding the
PT_GNU_RELRO p_memsz. This should now work properly for FreeBSD.
This commit is contained in:
parent
f32b3b5783
commit
4dd7e43662
1 changed files with 6 additions and 1 deletions
|
|
@ -1644,8 +1644,13 @@ template <class ELFT> void Writer<ELFT>::setPhdrs() {
|
|||
}
|
||||
if (P.p_type == PT_LOAD)
|
||||
P.p_align = Config->MaxPageSize;
|
||||
else if (P.p_type == PT_GNU_RELRO)
|
||||
else if (P.p_type == PT_GNU_RELRO) {
|
||||
P.p_align = 1;
|
||||
// The glibc dynamic loader rounds the size down, so we need to round up
|
||||
// to protect the last page. This is a no-op on FreeBSD which always
|
||||
// rounds up.
|
||||
P.p_memsz = alignTo(P.p_memsz, Target->PageSize);
|
||||
}
|
||||
|
||||
// The TLS pointer goes after PT_TLS. At least glibc will align it,
|
||||
// so round up the size to make sure the offsets are correct.
|
||||
|
|
|
|||
Loading…
Reference in a new issue