patching file elf/dl-load.c Hunk #1 FAILED at 1. Hunk #2 FAILED at 1150. 2 out of 2 hunks FAILED -- saving rejects to file elf/dl-load.c.rej patching file elf/dl-load.h Hunk #1 FAILED at 1. Hunk #2 FAILED at 74. 2 out of 2 hunks FAILED -- saving rejects to file elf/dl-load.h.rej patching file elf/dl-map-segments.h Hunk #1 FAILED at 1. Hunk #2 succeeded at 63 with fuzz 2 (offset 45 lines). Hunk #3 FAILED at 97. 2 out of 3 hunks FAILED -- saving rejects to file elf/dl-map-segments.h.rej Reject file elf/dl-load.c.rej: --- elf/dl-load.c +++ elf/dl-load.c @@ -1,5 +1,6 @@ /* Map in a shared object's segments from the file. Copyright (C) 1995-2021 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 @@ -1150,6 +1151,7 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd, c->mapend = ALIGN_UP (ph->p_vaddr + ph->p_filesz, GLRO(dl_pagesize)); c->dataend = ph->p_vaddr + ph->p_filesz; c->allocend = ph->p_vaddr + ph->p_memsz; + c->mapalign = ph->p_align; c->mapoff = ALIGN_DOWN (ph->p_offset, GLRO(dl_pagesize)); /* Determine whether there is a gap between the last segment Reject file elf/dl-load.h.rej: --- elf/dl-load.h +++ elf/dl-load.h @@ -1,5 +1,6 @@ /* Map in a shared object's segments from the file. Copyright (C) 1995-2021 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 @@ -74,7 +75,7 @@ ELF_PREFERRED_ADDRESS_DATA; Its details have been expanded out and converted. */ struct loadcmd { - ElfW(Addr) mapstart, mapend, dataend, allocend; + ElfW(Addr) mapstart, mapend, dataend, allocend, mapalign; ElfW(Off) mapoff; int prot; /* PROT_* bits. */ }; Reject file elf/dl-map-segments.h.rej: --- elf/dl-map-segments.h +++ elf/dl-map-segments.h @@ -1,5 +1,6 @@ /* Map in a shared object's segments. Generic version. Copyright (C) 1995-2021 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 @@ -97,10 +142,7 @@ _dl_map_segments (struct link_map *l, int fd, - MAP_BASE_ADDR (l)); /* Remember which part of the address space this object uses. */ - l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength, - c->prot, - MAP_COPY|MAP_FILE, - fd, c->mapoff); + l->l_map_start = _dl_map_segment (c, mappref, maplength, fd); if (__glibc_unlikely ((void *) l->l_map_start == MAP_FAILED)) return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;