#include <dl-dst.h>
#include <dl-load.h>
#include <dl-map-segments.h>
+#include <dl-map-segment-align.h>
#include <dl-unmap-segments.h>
#include <dl-machine-reject-phdr.h>
#include <dl-prop.h>
/* Optimize a common case. */
c->prot = pf_to_prot (ph->p_flags);
+
+ /* Architecture-specific adjustment of segment alignment. */
+ p_align_max = _dl_map_segment_align (c, p_align_max);
break;
case PT_TLS:
--- /dev/null
+/* _dl_map_segment_align. Generic version.
+ Copyright (C) 2026 Free Software Foundation, Inc.
+ Copyright The GNU Toolchain Authors.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <dl-load.h>
+
+static inline ElfW(Addr)
+_dl_map_segment_align (const struct loadcmd *c, ElfW(Addr) p_align_max)
+{
+ return p_align_max;
+}