[glibc] elf: Remove redundant _dl_map_segments declaration from dl-load.h
Wilco Dijkstra via Glibc-cvs <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6696ad38796586e1cf0ea9e9acaafae5cebce559 commit 6696ad38796586e1cf0ea9e9acaafae5cebce559 Author: WANG Rui <[email protected]> Date: Tue Apr 14 15:14:33 2026 +0000 elf: Remove redundant _dl_map_segments declaration from dl-load.h The function `_dl_map_segments` is defined in `<dl-map-segments.h>`, which provides the canonical implementation (optionally overridden by sysdeps variants). All call sites include `<dl-map-segments.h>` directly, so declaring `_dl_map_segments` in `dl-load.h` is unnecessary. Keeping a static prototype in `dl-load.h` can trigger -Wunused-function errors when the header is included by translation units that do not include `<dl-map-segments.h>` and do not reference `_dl_map_segments`. Since glibc builds with `-Werror`, this results in build failures [1]. Remove the redundant declaration from `dl-load.h` to avoid these spurious warnings and keep the declaration colocated with the definition as intended. [1] https://ci.linaro.org/job/tcwg_glibc_build--master-aarch64-precommit/4624/artifact/artifacts/artifacts.precommit/notify/mail-body.txt Reviewed-by: Wilco Dijkstra <[email protected]> Signed-off-by: WANG Rui <[email protected]> Diff: --- elf/dl-load.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/elf/dl-load.h b/elf/dl-load.h index dbc29b335e..897c4034c5 100644 --- a/elf/dl-load.h +++ b/elf/dl-load.h @@ -109,14 +109,15 @@ _dl_postprocess_loadcmd (struct link_map *l, const ElfW(Ehdr) *header, The file <dl-map-segments.h> defines this function. The canonical implementation in elf/dl-map-segments.h might be replaced by a sysdeps - version. */ + version. + static const char *_dl_map_segments (struct link_map *l, int fd, const ElfW(Ehdr) *header, int type, const struct loadcmd loadcmds[], size_t nloadcmds, const size_t maplength, bool has_holes, - struct link_map *loader); + struct link_map *loader); */ /* All the error message strings _dl_map_segments might return are listed here so that different implementations in different sysdeps